[DOCKER] Basic format of Dockefile

I have briefly summarized the basic formats used in Dockerfile. Dockerfile is a text file for building Docker images with the docker build command.

Basic description format

Format Explanation
FROM <image> Specify the Docker image that is the base of Docker image. It's a good idea to specify the minimum required so that the size does not become too large. Linux example:ubuntu:latestalpine:latest
RUN <command> Execute the command. Frequently used commands: apt-get update && apt-get install -y
CMD ["executable", "param1", "param2", ...] Default command when running a container

Other formats

Format Explanation
COPY When copying files and folders
ADD When copying and decompressing a compressed tar file
ENTRYPOINT Similar to CMD. It is used when the default command is not overwritten when executing with run.
ENV Set environment variables
WORKDIR Change the directory that executes the contents described in Dockerfile. When installing anaconda, not directly under root/opt/Install it on anaconda3.

Reference: Official document

Dockerfile Reference (Japanese) Dockerfile reference (English)

Recommended Posts

Basic format of Dockefile
Basic methods of Ruby hashes
Basic knowledge of SQL statements
Basic methods of Ruby arrays
Super basic usage of Eclipse
[Ruby] List of basic commands
Summary of basic functions of ImageJ
Review of Ruby basic grammar
Understand the basic mechanism of log4j2.xml
Basic knowledge of Ruby on Rails
The basic basis of Swift dialogs
The basic basis of Swift's Delegate
Basic usage of java Optional Part 1
Basic processing flow of java Stream
[Basic knowledge of Java] Scope of variables
Basic structure of Java source code
Basic basis of Android asynchronous processing "AsyncTask"
Basic knowledge of Java development Note writing
Basic usage of enums and code examples
[Basic knowledge of Java] About type conversion
Format the contents of LocalDate with DateTimeFormatter
The basic basis of Swift custom cells