docker build The command is used to create a mirror using Dockerfile. OPTIONS description: –build-arg=[] : Set the variable when the mirror is created –cpu-shares : Set cpu use weight –cpu-period : Limit the period of CPU CFS –cpu-quota : Limit CPU CFS quota –cpuset-cpus : Specify the CPU id to use –cpuset-mems : Specify the memory id used –disable-content-trust : Ignore the check and turn it on by default -f : Specify the Dockerfile path to use –force-rm : Delete intermediate containers during setting up mirroring –isolation : Use container isolation technology –label=[] : Set the metadata used by the mirror -m : Set the maximum memory value –memory-swap : Set the maximum value of Swap to memory + swap, and “- 1” means unlimited swap –no-cache : The process of creating a mirror does not use caching –pull : Try to update the new version of the mirror –quiet, -q : Quiet mode, only output image ID after success –rm : Delete the intermediate container after setting the image successfully –shm-size : Sets the size of / dev/shm. The default is 64m. –ulimit : Ulimit configuration. –squash : Compress all operations in Dockerfile into one layer. –tag, -t: The name and label of the image, usually in name:tag or name format; you can set multiple tags for one image at a time. –network: Default default. Set the network mode of the RUN instruction during the build Create an image using the Dockerfile of the current directory, labeled runoob/ubuntu:v1. Use URL github.com/creack/docker-firefox Create a mirror image with the Dockerfile of 2.56.1. Grammar ¶
docker build [OPTIONS] PATH | URL | -
2.56.2. Example ¶
docker build -t runoob/ubuntu:v1 .