Moe's Tech Blog

[Docker] Docker setup 및 실행 본문

Docker

[Docker] Docker setup 및 실행

moe12825 2022. 4. 22. 11:45

1. Create "Dockerfile" in project root folder

2. Populate "Dockerfile" with content similar to the following:

3. Make docker image using the following command (where Dockerfile is):

docker build .

After successful build, the following line will show

Successfully built <docker_image_id>

 

4. Run the container using the following command:

docker run -p <communication_port_address> <docker_image_id>

5. To stop the container, run the following command:

docker stop <docker_container_id>

And <docker_container_id> can be found using the following command:

docker ps

 

 

참고

1. Docker & Kubernetes - The Practical Guide [2022 Edition], Maximilian Schwarzmüller: https://www.udemy.com/course/docker-kubernetes-the-practical-guide/

'Docker' 카테고리의 다른 글

[Docker] 유용한 커멘드들  (0) 2022.04.22