- Mac
- Docker
- Pipeline Utility Steps => zip 명령어 사용(Jenkinsfile)
- 변수 BUILD_TIMESTAMP 사용 => (https://stackoverflow.com/questions/24226862/how-to-get-build-time-stamp-from-jenkins-build-variables)
- jenkins:lts 이미지 pull
- aws-cli 설치
- npm 설치
- nginx:1.14 이미지 pull
- nginx 내부 설정 커스텀을 위해 nginx 디렉토리를 컨테이너로 경로로 추가
- 위 이미지 2개로 만들어지는 컨테이너를 한번에 제어
- links 를 통해 nginx 에서 jenkins 컨테이너로 프록시 가능
$ docker build -t mygumi/jenkins .
$ docker build -t mygumi/jenkins_nginx . -f Dockerfile.nginx
$ docker-compose up
과정 중에 경험한 이슈
-
localhost vs 0.0.0.0 (https://stackoverflow.com/questions/59179831/docker-app-server-ip-address-127-0-0-1-difference-of-0-0-0-0-ip)
=> 1, 2번에 대한 이슈로 nginx 에서의 대안 upstream 에 app:8080 으로 지정 이 app 은 docker-compose.yml 에서 links 참고
- Cannot connect to the Docker daemon at unix:///var/run/docker.sock. /var/run/docker.sock:/var/run/docker.sock 로컬에 있는 docker 를 사용하기 위함.(https://medium.com/dtevangelist/docker-in-docker-fb54252e3188)