I will write what I learned about docker anyway (first)

next time

Write what you learned about docker anyway \ (second ) -Qiita

Reference books

Docker/Introduction to Kubernetes Practical Container Development|Akinori Yamada|Computer / IT|Kindle Store| Amazon

Docker container orchestration system

A method of managing many containers across multiple nodes Docker Swarm --Docker Compose allows you to manage multiple containers across multiple servers, not just a single server --In addition to managing multiple containers, there are also functions such as increasing / decreasing containers, arranging containers and distributing loads to efficiently use node resources.

Correlation between Docker image and Docker container

Docker image

--A collection of file systems and applications to be executed that make up the Docker container --The template used to create the container

Docker container

A file system and application running that was created and embodied based on a Docker image

image.png

--Docker image contains Ubuntu file system and running application

Dockerfile instructions

FROM The one that is the basis of the docker image

RUN Commands to be executed inside the Docker container when building a Docker image

COPY Instructions for copying files and directories into a Docker container on the host machine running Docker

Build image

docker image build -t image name[:Tab name]Dockerfile deployment directory path

Any image name can be specified for the -t option. Optional but almost mandatory

ENTRYPOINT

By using ENTRYPOINT, you can devise a way to execute commands in the container.

--If you specify ENTRYPOINT, the CMD argument becomes the argument of the file executed by ENTRYPOINT. --ENTRYPOINT can be useful when the image creator wants to limit the use of the container to some extent.

Other infrastructure

LABEL Enter the author name of the image

ENV Specify environment variables that can be used in the Docker container generated based on the Dockerfile

ARG Used to embed information at build time

Docker port forwarding

--In the case of an application that receives HTTP requests, it is necessary to make the request coming from outside the container reach the application running inside the container. --In port forwarding, you can link to a container port and forward communications coming from outside the container to the container port.

dokcer container run -p {Host side port}:{Container side port} {Various commands below}

Recommended Posts

I will write what I learned about docker anyway (first)
What I learned about Kotlin
What i learned
Summary of what I learned about Spring Boot
What I learned ② ~ Mock ~
What I learned ① ~ DJUnit ~
What I researched about Java 8
What I researched about Java 6
What you learned about hashes
What I researched about Java 9
What you learned about symbols
What I researched about Java 7
What I researched about Java 5
What I learned with Java Gold
What I learned with Java Silver
What I researched about Java learning
Take what you've learned about Java reflection
What I learned through the swift teacher
What is Docker? I tried to summarize
What I learned from Java monetary calculation
About Docker
About Docker
[Personal memo] I learned a little about modifiers
I tried using Docker for the first time
[Rails] I learned about database data type types!
What I learned in Java (Part 2) What are variables?
I tried touching Docker for the first time
Summary of what I learned in Spring Batch