描述
从Dockerfile构建映像
用法
docker image build [OPTIONS] PATH | URL | -
选项
名字,速记 | 默认 | 描述 |
--add-host | Add a custom host-to-IP mapping (host:ip) -----添加自定义主机到IP映射(host:ip) | |
--build-arg | Set build-time variables -----设置构建时变量 | |
--cache-from | Images to consider as cache sources -----要考虑作为缓存源的映像 | |
--cgroup-parent | Optional parent cgroup for the container -----容器的可选父cgroup | |
--compress | Compress the build context using gzip -----使用gzip压缩构建上下文 | |
--cpu-period | Limit the CPU CFS (Completely Fair Scheduler) period -----限制CPU CFS(完全公平计划程序)期间 | |
--cpu-quota | Limit the CPU CFS (Completely Fair Scheduler) quota -----限制CPU CFS(完全公平计划程序)配额 | |
--cpu-shares , -c | CPU shares (relative weight) -----CPU份额(相对权重) | |
--cpuset-cpus | CPUs in which to allow execution (0-3, 0,1) -----允许执行的CPU(0-3,0,1) | |
--cpuset-mems | MEMs in which to allow execution (0-3, 0,1) -----允许执行的MEM(0-3,0,1) | |
--disable-content-trust | true | Skip image verification -----跳过映像验证 |
--file , -f | Name of the Dockerfile (Default is ‘PATH/Dockerfile’) -----Dockerfile的名称(默认为'PATH / Dockerfile') | |
--force-rm | Always remove intermediate containers -----始终移除中间容器 | |
--iidfile | Write the image ID to the file -----将图像ID写入文件 | |
--isolation | Container isolation technology -----容器隔离技术 | |
--label | Set metadata for an image -----设置图像的元数据 | |
--memory , -m | Memory limit -----内存限制 | |
--memory-swap | Swap limit equal to memory plus swap: ‘-1’ to enable unlimited swap -----交换限制等于内存加交换:' - 1以启用无限制交换 | |
--network | API 1.25+ Set the networking mode for the RUN instructions during build -----在构建期间设置RUN指令的网络模式 | |
--no-cache | Do not use cache when building the image -----构建映像时不要使用缓存 | |
--output , -o | API 1.40+ Output destination (format: type=local,dest=path) -----输出目的地(格式:type = local,dest = path) | |
--platform | experimental (daemon)API 1.32+ Set platform if server is multi-platform capable -----如果服务器具有多平台功能,则设置平台 | |
--progress | auto | Set type of progress output (auto, plain, tty). Use plain to show container output -----设置进度输出类型(auto,plain,tty)。使用plain显示容器输出 |
--pull | Always attempt to pull a newer version of the image -----始终尝试拉出较新版本的映像 | |
--quiet , -q | Suppress the build output and print image ID on success -----成功时禁止构建输出并打印映像ID | |
--rm | true | Remove intermediate containers after a successful build -----成功构建后删除中间容器 |
--secret | API 1.39+ Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret -----要暴露给构建的秘密文件(仅当启用了BuildKit时):id = mysecret,src = / local / secret | |
--security-opt | Security options -----安全选项 | |
--shm-size | Size of /dev/shm -----/ dev / shm的大小 | |
--squash | experimental (daemon)API 1.25+ Squash newly built layers into a single new layer -----新构建的图层压缩到一个新图层中 | |
--ssh | API 1.39+ SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|[=|[,]]) -----SSH代理套接字或用于公开构建的密钥(仅当启用了BuildKit时)(格式:default |[=|[,]]) | |
--stream | experimental (daemon)API 1.31+ Stream attaches to server to negotiate build context -----Stream附加到服务器以协商构建上下文 | |
--tag , -t | Name and optionally a tag in the ‘name:tag’ format -----以“name:tag”格式命名和选择标记 | |
--target | Set the target build stage to build. -----设置要构建的目标构建阶段。 | |
--ulimit | Ulimit options -----Ulimit选项 |