I've only heard of Docker ...

I changed my job to an in-house developed company from inexperienced, and now it is my second day of work. Since the local environment construction has been completed earlier, I will write the output. I would appreciate it if you could point out any incorrect statements.

Referenced site https://qiita.com/tsuboyataiki/items/90dbe94553d3dea39b19 https://knowledge.sakura.ad.jp/13265/ https://qiita.com/wasanx25/items/d47caf37b79e855af95f

What is Docker?

Docker is a technology that is attracting attention in the infrastructure and DevOps area (a phrase that combines the development team and the operation team), and is a platform developed by Docker for creating, distributing, and executing container-type virtual environments. is.

It uses Linux container technology, and by using the kernel of the host machine to isolate processes and users, it can be made to look as if another machine is running.

What are the benefits of using it? ??

-Lightweight and can be started and stopped at high speed. -By sharing the coded file, anyone can create the same environment anywhere. -By passing the created Docker image to other people, it will lead to prevention of version shift of each environment and shortening of development environment preparation.

Check the current container

In the Docker project directory

Terminal


$ docker-compose ps

Do the above. This will display the name and status of the container.

Start container

After confirming that the container exists, it is finally started.

Terminal


$ docker-compose up -d

Builds, (re) creates, launches, and attaches service containers. With the "-d" option, the container will start in the background and continue to run.

Depending on the person, it may take a long time here, so be patient. On the command line if the startup is successful

Terminal


Use Ctrl-C to stop

It will be displayed.

Other commands

View log

View the service log. (You can also specify the service name as an argument.)

Terminal


$ docker-compose logs

Stop container

Stop the container and delete the container and network by referring to the service described in docker-compose.yml.

Terminal


$ docker-compose down

Reboot

Terminal


$ docker-compose restart

Finally

I've just started touching it today and I still can't catch up with it at all, so I'll deepen my understanding one by one. I will update this article as I learn more and more.

Recommended Posts

I've only heard of Docker ...
Introduction of Docker --Part 1--
Overview of Docker and containers
Docker monitoring-explaining the basics of basics-
About simple operation of Docker
[Docker] Introduction of basic Docker Instruction
Understand the basics of docker
Get only the ID of the container specified by docker ps
Qualify only part of the text
[Docker Network Chapter 2] Explanation of Docker Networking
[Docker Network Chapter 1] Explanation of Docker Networking
Summary of frequently used Docker commands
Docker [Batch deletion of <none> tags]