CI/CD에 대한 공부를 이론으로만 하는 것에서 한계를 느껴 직접 체험해보고자, jenkins를 설치하고자 한다. 필자는 아래와 같은 환경에서 설치했다.
docker run -itd --name jenkins -p 8085:8080 jenkins/jenkins:lts
필자는 docker pull 후 run을 했을 때 아래와 같은 에러가 떴었다.
docker: Error response from daemon: Mounts denied:
The path /docker/jenkins is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.
위의 에러의 원인의 이유는 Docker가 Mount를 하기위해 사용하는 Folder를 벗어났기에 거부 당한것이다. 이것은 아래의 그림 처럼 해결하기 바란다.
1. Docker의 Setting에서 Resources에 들어간다.
2. Resources에서 files sharing에서 에러의 path를 추가해준다.(ex: /jenkins)
2.이미지 풀과 동시에 run이 끝나면 우리는 위에 설정한 포트로 들어가면 아래와 같은 화면이 나온다.
docker exec -it jenkins /bin/bash container> cat /var/jenkins_home/secrets/initialAdminPassword
위의 명령을 치면 나오는 긴 비밀번호를 입력해주면 이제 설치가 가능하다.