I tried touching Docker for the first time

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!

Prior knowledge and related matters.

Please refer to the following article.

Table of contents
  • What is Docker?
  • Docker installation
  • Get image, start container

What is Docker? Roughly speaking, container-type virtualization technology was born to solve the problem of "heavy" virtual machines that originally existed, and Docker is a representative of container-type virtualization technology. (For details, please refer to this article (article is being created) )

From installation to startup 1. Install Docker The installation method is carefully described on the official page. The ones to be installed differ depending on the OS you are using, so please install the appropriate ones from the official page below. : point_right_tone1: Docker official page   2. Check the version After the installation is complete, check the versions of Docker and Docker composer. At the command prompt, type the following command.  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. Screen Shot 2020-11-15 at 11.46.41 AM.png

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

  • Please read the port as appropriate.

If the screen below appears, the container has been started successfully!

Screen Shot 2020-11-15 at 12.02.57 PM.png

Summary So far, I have summarized from Docker installation to container startup. What did you think. I hope you find it helpful!

Recommended Posts

I tried touching Docker for the first time
I tried using Docker for the first time
[Rails] I tried using the button_to method for the first time
I tried the Docker tutorial!
Spring Boot for the first time
Spring AOP for the first time
Introduction to java for the first time # 2
Touching kotlin for the first time-Enum Classes
Learning for the first time java [Introduction]
Java14 came out, so I tried record for the time being
Walls hit by Rspec for the first time
Android Studio development for the first time (for beginners)
I tried to summarize the state transition of docker
I tried installing the Docker Integration plugin in IntelliJ
Learn for the first time java # 3 expressions and operators
I tried using Docker Desktop for Windows on Windows 10 Home
Oreore certificate https (2020/12/19) for the first time with nginx
Learning memo when learning Java for the first time (personal learning memo)
[WIP] I tried the configuration of Docker + Streama + NFS
Command to try using Docker for the time being
How to study kotlin for the first time ~ Part 2 ~
How to study kotlin for the first time ~ Part 1 ~
I tried the VueJS tutorial!
I tried the FizzBuzz problem
I tried BIND with Docker
[CircleCI] I will explain the stupid configuration file (config.yml) that I wrote for the first time.
I tried to build the environment little by little using docker
I tried to build the environment of WSL2 + Docker + VSCode
left4dead2 I made a Docker image for the server and tried running it on GCE # 3 (I had a hard time building the server)
Modeling a Digimon with DDD for the first time Part 1
docker What should I do first? (Somehow I understand the shell, but ... for beginners at the level)
I tried to explain the method
Think when Rails (turbolinks) doesn't load the page for the first time
I tried to build the environment of PlantUML Server with Docker
[Introduction] Installation of Docker Desktop for Mac for the first time and setup of virtual environment construction of CentOS
[Introduction] Setting up GridDB Community Edition in the CentOS container of Docker Desktop for the first time
I tried to summarize the methods used
I tried running the Angular sample in Auth0 Quick Start with Docker
For the time being, run the war file delivered in Java with Docker
I tried running Docker on Windows Server 2019
I tried Cassandra's Object Mapper for Java
I tried using Scalar DL with Docker
I tried the new era in Java
[First Java] Make something that works with Intellij for the time being
The story of releasing the Android app to the Play Store for the first time.
I tried to implement the Iterator pattern
Microservices 101-I tried putting Docker on Ubuntu-
I tried to summarize the Stream API
[Socket communication (Java)] Impressions of implementing Socket communication in practice for the first time
I tried the AutoValue library in Intellij
What is Docker? I tried to summarize
Creating an app and deploying it for the first time on heroku
Programming for the first time in my life Java 1st Hello World
Time shift measures with Docker for Windows
I tried migrating the portfolio created on Vagrant to the Docker development environment
I will absolutely convert the time string!
Use the l method for time notation
Ideal and reality that I felt when I used Optional for the first time ~ Implementation of cache using Map ~
Fat Can, Docker and I look back on the quotes of First Gundam
The story of intentionally using try catch for the first time in my life
[First environment construction] I tried to create a Rails 6 + MySQL 8.0 + Docker environment on Windows 10.