The Docker build command is used to create a mirror using Dockerfile.
Grammar
Docker build [OPTIONS] PATH | URL | -
Options Description:
--build-arg=[]: Sets the variable when the image is created;
--cpu-shares: set CPU usage weight;
--cpu-period: limit the CPU CFS cycle;
--cpu-quota: limit CPU CFS quotas;
--cpuset-cpus: Specifies the CPU ID used;
--cpuset-mems: Specifies the memory ID used;
--disable-content-trust: Ignore the check, the default is turned on;
- F: Specifies the dockerfile path to use;
--force-rm: Delete Intermediate container during setting mirroring;
--isolation: using container isolation technology;
--label=[]: Set the metadata used by the image;
- m: sets the maximum memory value;
--memory-swap: set the maximum swap value is memory +swap, "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 image;
--quiet,-Q: quiet mode, after successful only output image ID;
--rm: After setting the image successfully, delete the intermediate container;
--shm-size: Set the size of the/DEV/SHM, the default value is 64M;
--ulimit: Ulimit configuration.
--tag,-t: the name and label of the image, usually Name:tag or name format; You can set multiple tags for one mirror in a single build.
--network: default. Setting the network mode of the Run command during build
Instance
Create the image using the Dockerfile of the current directory, labeled RUNOOB/UBUNTU:V1:
Create the image using the Dockerfile of the URL github.com/creack/docker-firefox :
Docker Build Github.com/creack/docker-firefox
You can also use the location of the-F Dockerfile file:
Docker Build-f/path/to/a/dockerfile.
Before the Docker daemon executes the instructions in Dockerfile, the Dockerfile is first checked for syntax and is returned when there is a syntax error:
Docker build-t Test/myapp.
"Docker Command"-build command