Difference between revisions of "Docker build"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<code>docker build</code> builds an image from a <code>[[Dockerfile]]</code> | <code>docker build</code> builds an image from a <code>[[Dockerfile]]</code> | ||
* https://docs.docker.com/engine/reference/commandline/build/ | * https://docs.docker.com/engine/reference/commandline/build/ | ||
− | --tag , -t Name and optionally a tag in the 'name:tag' format | + | [[--tag]] , -t Name and optionally a tag in the 'name:tag' format |
[[--platform]]=[[linux/amd64]] | [[--platform]]=[[linux/amd64]] | ||
+ | [[docker build --help|--help]] | ||
== Build an image without repo/tag/name == | == Build an image without repo/tag/name == | ||
Line 14: | Line 15: | ||
* <code>docker build -t my-image_name:my-tag /path/to/your/code/and/dockerfile/</code> | * <code>docker build -t my-image_name:my-tag /path/to/your/code/and/dockerfile/</code> | ||
− | * <code>docker build -- | + | * <code>docker build [[--tag]] my-confluence-image-name --build-arg [[CONFLUENCE]]_VERSION=6.x.x</code> |
* <code>docker build -t myregistry.jfrog.io/backend/test --push --progress=plain .</code> | * <code>docker build -t myregistry.jfrog.io/backend/test --push --progress=plain .</code> | ||
Line 63: | Line 64: | ||
* [[BuildKit]] | * [[BuildKit]] | ||
* <code>[[docker buildx prune]]</code> | * <code>[[docker buildx prune]]</code> | ||
− | + | * <code>[[buildah]]</code> | |
== See also == | == See also == |
Latest revision as of 18:57, 30 March 2023
docker build
builds an image from a Dockerfile
--tag , -t Name and optionally a tag in the 'name:tag' format --platform=linux/amd64 --help
Build an image without repo/tag/name[edit]
docker build -t my-image_name .
docker build -t my-image_name:my-tag .
docker build -t my-image_name:my-tag /path/to/your/code/and/dockerfile/
docker build --tag my-confluence-image-name --build-arg CONFLUENCE_VERSION=6.x.x
docker build -t myregistry.jfrog.io/backend/test --push --progress=plain .
docker build -t openalpr https://github.com/openalpr/openalpr.git
docker build --build-arg arch=$arch -t your_artifactory.your_domain.com/test-multi-arch/busybox:$arch-test .
docker build --cache-from=
docker build --platform=linux/amd64
Examples with errors[edit]
docker build "docker build" requires exactly 1 argument. See 'docker build --help'. Usage: docker build [OPTIONS] PATH | URL | - Build an image from a Dockerfile
docker build . [+] Building 0.0s (2/2) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2B 0.0s => CANCELED [internal] load .dockerignore 0.0s => => transferring context: 0.0s failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount071917527/Dockerfile: no such file or directory
Related terms[edit]
Dockerfile
, FROMdocker run
docker push
docker pull
docker save
docker load
docker-compose build
docker buildx build .
docker tag
tinit
init for containersminikube image build
podman build
yarn build
- Kaniko (2018)
- BuildKit
docker buildx prune
buildah
See also[edit]
Advertising: