我的作業系統是 Windows 11
用 Docker Compose 建立一個 GitLab 及 GitLab Runner的容器
docker-compose.yml 檔案內容如下
version: '3.8'
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
hostname: gitlab
ports:
- "80:80"
- "443:443"
- "22:22"
volumes:
- .gitlab-config:/etc/gitlab
- .gitlab-logs:/var/log/gitlab
- .gitlab-data:/var/opt/gitlab
shm_size: '256m'
networks:
- gitlab-network
gitlab-runner:
image: gitlab/gitlab-runner:latest
container_name: gitlab-runner
restart: always
depends_on:
- gitlab
volumes:
- .gitlab-runner-config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
networks:
- gitlab-network
networks:
gitlab-network:
driver: bridge
執行器Runner狀態
執行器Runner設定內容
建立了一個專案 ci-cd-demo
.gitlab-ci.yml內容如下
helloworld:
script:
- echo "hello world, GitLab!"
執行錯誤畫面
錯誤訊息
fatal: unable to access 'http://gitlab/root/ci-cd-demo.git/': Failed to connect to gitlab port 80 after 3 ms: Could not connect to server
Retrying in 5s
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
請問各位前輩該如何排除問題?