소개
"첫 번째 컨테이너 실행하기" 챌린지에 오신 것을 환영합니다! 여러분은 이미 hello-world 컨테이너를 실행하는 방법을 배웠습니다. 이제 한 걸음 더 나아가 색다르고 흥미로운 컨테이너를 실행해 보겠습니다. 이번 챌린지에서는 지금까지 익힌 도커 기술을 활용하여 유용한 메시지를 보여주는 컨테이너를 직접 구동해 볼 것입니다.
"첫 번째 컨테이너 실행하기" 챌린지에 오신 것을 환영합니다! 여러분은 이미 hello-world 컨테이너를 실행하는 방법을 배웠습니다. 이제 한 걸음 더 나아가 색다르고 흥미로운 컨테이너를 실행해 보겠습니다. 이번 챌린지에서는 지금까지 익힌 도커 기술을 활용하여 유용한 메시지를 보여주는 컨테이너를 직접 구동해 볼 것입니다.
수행해야 할 과제는 간단합니다:
docker/getting-started 이미지를 기반으로 도커 컨테이너를 실행하세요.챌린지를 성공적으로 완료하려면 다음 조건을 충족해야 합니다:
docker run 명령어를 사용하여 컨테이너를 시작해야 합니다.docker/getting-started 이미지를 사용하세요. 이 이미지는 이미 시스템에 내려받아져 (pre-pulled) 있습니다.~/project 디렉토리에서 명령어를 실행하세요.컨테이너를 성공적으로 실행하면 도커와 관련된 정보가 포함된 출력 결과가 나타납니다.
실행 도중 /docker-entrypoint.d/ 디렉토리가 비어 있지 않다는 경고 메시지가 나타나더라도 당황하지 마세요. 정상적인 동작입니다.
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/10/29 09:26:17 [notice] 1#1: using the "epoll" event method
2024/10/29 09:26:17 [notice] 1#1: nginx/1.23.3
2024/10/29 09:26:17 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
2024/10/29 09:26:17 [notice] 1#1: OS: Linux 5.15.0-56-generic
2024/10/29 09:26:17 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/10/29 09:26:17 [notice] 1#1: start worker processes
2024/10/29 09:26:17 [notice] 1#1: start worker process 31
2024/10/29 09:26:17 [notice] 1#1: start worker process 32
새 터미널 창을 열고 docker ps 명령어를 사용하여 컨테이너가 실제로 실행 중인지 확인할 수 있습니다.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f3f3b3b3b3b3 docker/getting-started "/docker-entrypoint.…" 1 minute ago Up 1 minute 80/tcp festive_mendel
주의: Continue 버튼을 클릭하기 전까지는 터미널을 종료하지 마세요.
이번 챌린지를 통해 새로운 컨테이너를 직접 실행해 보며 도커 실력을 한 단계 높였습니다. docker run 명령어로 docker/getting-started 이미지를 실행하여 도커에 대한 소개 정보를 확인해 보았습니다. 이 과정에서 도커를 활용해 컨테이너를 구동하는 방법을 복습하고, 유용한 정보를 담고 있는 새로운 도커 이미지를 접해 보았습니다. 도커를 사용하면 미리 설정된 애플리케이션에 얼마나 빠르고 간편하게 접근할 수 있는지 체감할 수 있는 좋은 기회였습니다. 앞으로도 다양한 도커 이미지를 탐색하며 컨테이너화 기술을 계속해서 확장해 나가시기 바랍니다!