In docker, build means "create"; this command is used to build a Docker image based on the given Dockerfile and context. The syntax is "docker build [OPTIONS] PATH | URL | -", Dockerfile It is a text file used to build an image. The text content contains the instructions and instructions required to build the image.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
The docker build command is used to create an image using a Dockerfile.
Syntax
docker build [OPTIONS] PATH | URL | -
OPTIONS Description:
--build-arg=[]: Set variables when creating the image;
--cpu-shares: Set cpu usage weight;
--cpu-period: Limit CPU CFS cycle;
--cpu-quota: Limit the CPU CFS quota;
--cpuset-cpus: Specify the CPU id used;
--cpuset-mems: Specify the memory id used;
--disable-content-trust: Ignore verification, enabled by default ;
-f: Specify the Dockerfile path to be used;
--force-rm: Delete the intermediate container during the mirroring process;
--isolation: Use container isolation technology;
--label=[]: Set the metadata used by the image;
-m: Set the maximum memory value;
--memory-swap: Set the maximum value of Swap to memory swap, "-1" means no limit swap;
--no-cache: The process of creating the image does not use cache;
--pull: Try to update the new image of the image Version;
--quiet, -q: Quiet mode, only the image ID will be output after success;
--rm: The image is set successfully Then delete the intermediate container;
--shm-size: Set the size of /dev/shm, the default value is 64M;
-- ulimit: Ulimit configuration.
--squash: Compress all operations in the Dockerfile into one layer.
--tag, -t: The name and tag of the image, usually in the format of name:tag or name; multiple tags can be set for one image in one build.
--network: default default. Set the network mode of the RUN command during build
##The example is as follows:
docker build -t runoob/ubuntu:v1 .
docker build github.com/creack/docker-firefox
$ docker build -f /path/to/a/Dockerfile .
$ docker build -t test/myapp . Sending build context to Docker daemon 2.048 kB Error response from daemon: Unknown instruction: RUNCMD
docker video tutorial"
The above is the detailed content of What does build mean in docker?. For more information, please follow other related articles on the PHP Chinese website!