Hello. Mun: grinning: I decided to use Docker for the next project, so I tried to touch it a little. I wrote it as a memorandum for myself, but I hope this article will be useful for those who touch Docker for the first time! Feel free to comment if you have any mistakes about the content of the article or any advice you should do: sunny:
Let's visit for the first time!
Please refer to the following article. p>
docker -v
docker composer -v
![JPEGイメージ-9BA33E12401D-1.jpeg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/183584/0f46e612-cf48-0d5c-d526-35d45c5f5dd6.jpeg)
* Docker composer is a tool used when operating multiple containers, but this time it will not be used.
3. Start the container from the terminal
You need an image to start the container, but that image is
There are "How to get from Docker Hub on the WEB" and "How to create by yourself".
This time, I will explain the former as an introductory book.
After installation, open Docker and you will see the screen below.
![Screen Shot 2020-11-10 at 4.25.38 PM.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/183584/b91a45fb-410f-f534-6469-1f6c5fc4c1ac.png)
The displayed command is to get the tutorial image from Docker Hub and start the container.
This time, let's start nginx instead of the tutorial container.
Type the following command into the terminal, get the image of nginx from Docker hub, and start the container.
docker run --name some-nginx -d -p 8080:80 nginx
If the port of a process that has already started is covered and you get angry, either drop the process that has already started or start the container on a different port.
If the startup is successful, RUNNING will be displayed as shown below.
In addition to nginx, Docker hub has various other images such as apache, so I recommend you to try it!
4. Make sure the container is running.
Access the following URL from your browser.
http://localhost:8080
If the screen below appears, the container has been started successfully!
Recommended Posts