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.
- Docker Hub saved in - Docker image (recipe for making a container) - Docker container - Docker engine runs.
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 Push
ing 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!
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. |
Virtual environment started based on Docker image information
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.
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! !! !!
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