ci/cd tool / cd tool / gocd
docker 를 사용해서 GoCD 실행하기
- server:
docker run -e MSG_TIME=0 -p 8153:8153 -p 8154:8154 -v ./godata:/godata --name mygocd gocd/gocd-server:v21.3.0
c:\> docker run -e MSG_TIME=0 -p 8153:8153 -p 8154:8154 -v ./godata:/godata --name mygocd gocd/gocd-server:v21.3.0
c:\> docker inspect --format="{{(index (index .NetworkSettings.IPAddress))}}" mygocd
172.17.0.2
c:\> docker run --rm -e GO_SERVER_URL=http://172.17.0.2:8153/go --name mygocd-agent gocd/gocd-agent-alpine-3.14:v21.3.0
docker-compose.yml
아래 git repository 에서 GoCD 에 대한 docker-compose.yml
file 을 얻을 수 있다.
그런데 오래된 것이라서 아래처럼 수정했다.
version: "3"
services:
server:
container_name: gocd-server
hostname: gocdserver
ports:
- 8153:8153
image: gocd/gocd-server:v21.3.0
volumes:
- ./godata:/godata
environment:
- MSG_TIME=0
agent:
image: gocd/gocd-agent-alpine-3.14:v21.3.0
environment:
- GO_SERVER_URL=http://gocdserver:8153/go
depends_on:
- server
networks:
gocdnet:
# docker run --rm -e MSG_TIME=0 -p 8153:8153 -v ./godata:/godata --name mygocd gocd/gocd-server:v21.3.0
# docker inspect --format="{{(index (index .NetworkSettings.IPAddress))}}" mygocd
# docker run --rm -e GO_SERVER_URL=http://172.17.0.2:8153/go --name mygocd-agent gocd/gocd-agent-alpine-3.14:v21.3.0
- gocd/docker-gocd-server: Docker server image for GoCD
- gocd/docker-gocd-agent-centos-8: CentOS 8 based GoCD agent.
- gocd/docker-gocd-agent-alpine-3.14: GoCD docker agent for Alpine 3.14
- gocd/gocd-agent-alpine-3.14 - Docker Image | Docker Hub
docker compose up
위의 docker-compose.yml
을 사용해서 docker compose up
을 하자.
mkdir godata
docker compose up
위 compose file 을 보면 알겠지만, godata
directory 가 mount 된다.
gocd server로 접속
그리고 http://localhost:8153
으로 접속하면 된다.
- http://localhost:8153
agent 를 여러개 띄우기
아래처럼 실행하면 agent 라는 service 를 3개 실행시키게 된다.
docker compose up --sacle agent=3
gradle task 사용하기
See Also
- docker-compose scale | Docker Documentation
- 쿠…sal: [컴] GoCD 설치
- Control startup and shutdown order in Compose | Docker Documentation
댓글 없음:
댓글 쓰기