About Docker

What is Docker

A tool for building a virtual environment using" container technology ". The most popular open source software developed by Docker You can easily create a container because you have put together the effort to establish it as one container.

How Docker works

- Docker Hub saved in - Docker image (recipe for making a container) - Docker container - Docker engine runs.

Docker Hub (Registry)

Container sharing service for Docker. Almost GitHub. (1) Since many Docker images are rolling, Pull from there to create a container. (Create a container with the run command based on the pulled image) (2) Develop and work with the created container, and commit it as an image. ③ Upload the committed image to your repository by Pushing it to Docker Hub. ④ When you want to use an image on a different PC for development work, just Pull the uploaded image and it's OK!   image.png

Docker image

The source of the container, the template, the package. An image is made up of layers of files called layers. If you don't have the image you want, you can create your own using Dockerfile .


FROM  ubuntu:18.10       #Specifying the base OS

LABEL version="1.0"        #Meta information of Dockerfile (information that says this is File)
LABEL description="Dockerfile test, Apache server"
 
RUN   apt-get update
RUN   apt-get install -y apache2   #Installation of layers that go into this File

CMD   ["apachectl", "-D", "FOREGROUND"]  #The above RUN is started by the command

command Execution content
FROM Specifies the base (parent) image.
LABEL Provides metadata. A good place to include maintainer information.
ENV Set persistent environment variables.
RUN Run the command to create the image layer. Used to install the package in a container.
COPY Copy the files and directories to the container.
ADD Copy the files and directories to the container. Local.You can unpack the tar file.
CMD Provides commands and arguments to the running container. The parameters can be overridden. There is only one CMD.
WORKDIR Set the working directory for the instructions that follow.
ARG Define variables to pass to Docker at build time.
ENTRYPOINT Provides commands and arguments to the running container. The argument persists.
EXPOSE Publish the port.
VOLUME Create a directory mount point to access and store persistent data.

Docker container

Virtual environment started based on Docker image information

Docker engine

The heart of Docker, this is Docker, and it is Docker itself. It is for transmitting commands from containers and images to the host OS and running them.

It consists of three elements

• The part that accepts commands • REST API (stateless data exchange) • Docker daemon (where it interacts with the host OS) It is divided into.

image.png

Summary

It's wonderful that you can set the environment so easily, it's light and it's easy to use. !! It seems that there are various disadvantages, but it is convenient because it is easy to use! !! !!

reference

http://docs.docker.jp/v1.12/engine/understanding-docker.html https://qiita.com/shubatto/items/105f5b90e1cd91ba7c4c https://blog.codecamp.jp/docker-file-how-to https://tech-lab.sios.jp/archives/19073 https://knowledge.sakura.ad.jp/13265/ https://www.youtube.com/watch?v=VIzLh4BgKck

Recommended Posts

About Docker
About Docker capacity
About =
About Java 10 Docker support
docker
About simple operation of Docker
About Docker Hub pull limit
docker memo
About Kotlin
About attr_accessor
About Hinemos
kubernetes + docker
spring × docker
About params
About Rails 6
About form_for
About Spring ③
Docker basics
About enum
About Optional
About hashes
About JitPack
About Dockerfile
Docker installation
About this ()
About devise
About encapsulation
About JAVA_HOME
Docker command
About active_hash
About static
About exceptions
Docker memorandum
Understand Docker
Docker memorandum
About scope
[Maven] About Maven
About Docker, disguise server and container
docker tutorial (memo)
(Almost about infrastructure) Read Docker textbooks for programmers. 1
Review about bundler
What is Docker?
About Java interface
Docker basic summary
[Java] About Java 12 features
Technical memorandum (Docker)
About Rails routing
Docker + Laravel + Codeception
About cyclomatic complexity
Liberty on Docker
About exception handling
Docker operation memo
[wip] Docker notes
Memorandum docker command
About AsyncTask Generics
Learn more about docker image and Dockerfile FROM
About Ruby symbols
About HotSpot VM
Docker command list
About ruby ​​form
[Swift] About generics