2.56. Docker build command

发布时间 : 2025-10-25 12:31:04 UTC      

Page Views: Stats unavailable

Docker 命令大全

docker build The command is used to create a mirror using Dockerfile.

2.56.1. Grammar

docker build [OPTIONS] PATH | URL | -

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

2.56.2. Example

Create an image using the Dockerfile of the current directory, labeled runoob/ubuntu:v1.

docker build -t runoob/ubuntu:v1 .

Use URL github.com/creack/docker-firefox Create a mirror image with the Dockerfile of

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.