본문 바로가기
강의 실습/비전공자도 이해할 수 있는 Docker 입문 실전

[실습] Docker 전체 흐름 느껴보기 (Nginx 설치 및 실행)

by jint 2026. 4. 29.

1. Docker를 조작하려면?
터미널에서 명령어를 통해 Docker를 조작 (CLI)


2. Nginx 란?
Nginx란 여러 기능을 가진 서버 중 하나로, 웹 서버(HTML 웹 페이지를 렌더링 시키는 역할), 로드 밸런싱, 리버스 프록시 역할을 한다.


3. 무적정 따라하면서 Docker 사용해보기
1) Nginx 이미지 다운로드
Docker Hub - nginx : https://hub.docker.com/_/nginx

 

nginx - Official Image | Docker Hub

⁠Quick reference ⁠Supported tags and respective Dockerfile links 1.29.8, mainline, 1, 1.29, latest, 1.29.8-trixie, mainline-trixie, 1-trixie, 1.29-trixie, trixie⁠ 1.29.8-perl, mainline-perl, 1-perl, 1.29-perl, perl, 1.29.8-trixie-perl, mainline-trixi

hub.docker.com

 

$ docker pull nginx


- Windows PowerShell

PS C:\Users\admin> docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
801a1ad15b4e: Pull complete
3531af2bc2a9: Pull complete
ff048f1f2159: Pull complete
ce776bbcda0d: Pull complete
677c63196868: Pull complete
85c66128325a: Pull complete
4677c2a9a3d4: Pull complete
69989ccd189b: Download complete
54c38c75806e: Download complete
Digest: sha256:6e23479198b998e5e25921dff8455837c7636a67111a04a635cf1bb363d199dc
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview nginx


2) 다운로드 된 이미지 확인

$ docker image ls


- Windows PowerShell

PS C:\Users\admin> docker image ls
                                                                                                                                                                                             i Info →   U  In Use
IMAGE          ID             DISK USAGE   CONTENT SIZE   EXTRA
nginx:latest   6e23479198b9        240MB         65.8MB


3) 이미지를 컨테이너에 올려 Nginx 서버 실행

$ docker run --name webserver -d -p 80:80 nginx


- Windows PowerShell

PS C:\Users\admin> docker run --name webserver -d -p 80:80 nginx
d8b8a89f1e1db4d98f82f3238c7d84a9c7b1ddea51a1af7e12a1e366eb1464ef


4) Nginx 서버가 잘 실행되는 지 확인
브라우저에서 http://localhost:80/ 접속

 

Nginx 서버 실행 확인


5) 실행되고 있는 모든 컨테이너 상태 확인

$ docker ps


- Windows PowerShell

PS C:\Users\admin> docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS                                 NAMES
d8b8a89f1e1d   nginx     "/docker-entrypoint.…"   3 minutes ago   Up 3 minutes   0.0.0.0:80->80/tcp, [::]:80->80/tcp   webserver


6) 특정 컨테이너 정지

$ docker stop webserver


- Windows PowerShell

PS C:\Users\admin> docker stop webserver
webserver


이후 브라우저에서 http://localhost:80/ 접속하면 Nginx 서버가 종료된 것을 확인할 수 있다.

 

Nginx 서버 종료 확인

 

그림으로 이해하기



참고링크 : https://www.inflearn.com/course/%EB%B9%84%EC%A0%84%EA%B3%B5%EC%9E%90-docker-%EC%9E%85%EB%AC%B8-%EC%8B%A4%EC%A0%84?cid=334085

 

비전공자도 이해할 수 있는 Docker 입문/실전| JSCODE 박재성 - 인프런 강의

현재 평점 4.9점 수강생 14,438명인 강의를 만나보세요. 비전공자 입장에서도 쉽게 이해할 수 있고, 실전에서 바로 적용 가능한 Docker 입문/실전 강의를 만들어봤습니다! Docker 기본 개념, Spring Boot를

www.inflearn.com

댓글