-
-
Save tonistiigi/5c86c720d196ce74d989ea37b325a621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@dev3:/tmp/foo# | |
root@dev3:/tmp/foo# docker images | |
REPOSITORY TAG IMAGE ID CREATED SIZE | |
root@dev3:/tmp/foo# docker build --platform=linux/amd64,linux/arm64 -t foo . | |
[+] Building 5.8s (12/12) FINISHED | |
=> [internal] load build definition from Dockerfile 0.1s | |
=> => transferring dockerfile: 90B 0.0s | |
=> [internal] load .dockerignore 0.1s | |
=> => transferring context: 2B 0.0s | |
=> [linux/arm64 internal] load metadata for docker.io/library/alpine:latest 1.8s | |
=> [linux/amd64 internal] load metadata for docker.io/library/alpine:latest 1.8s | |
=> [linux/arm64 1/3] FROM docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 1.6s | |
=> => resolve docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 0.1s | |
=> => sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 1.64kB / 1.64kB 0.0s | |
=> => sha256:1827be57ca85c28287d18349bbfdb3870419692656cb67c4cd0f5042f0f63aec 528B / 528B 0.0s | |
=> => sha256:61ebf0b9b18f3d296e53e536deec7714410b7ea47e4d0ae3c121b221d8ae8129 1.51kB / 1.51kB 0.0s | |
=> => sha256:8bfa913040406727f36faa9b69d0b96e071b13792a83ad69c19389031a9f3797 2.72MB / 2.72MB 0.3s | |
=> => extracting sha256:8bfa913040406727f36faa9b69d0b96e071b13792a83ad69c19389031a9f3797 0.8s | |
=> [internal] load build context 0.1s | |
=> => transferring context: 90B 0.0s | |
=> [linux/amd64 1/3] FROM docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 1.6s | |
=> => resolve docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 0.1s | |
=> => sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 1.64kB / 1.64kB 0.0s | |
=> => sha256:e4355b66995c96b4b468159fc5c7e3540fcef961189ca13fee877798649f531a 528B / 528B 0.0s | |
=> => sha256:965ea09ff2ebd2b9eeec88cd822ce156f6674c7e99be082c7efac3c62f3ff652 1.51kB / 1.51kB 0.0s | |
=> => sha256:89d9c30c1d48bac627e5c6cb0d1ed1eec28e7dbdfbcc04712e4c79c0f83faf17 2.79MB / 2.79MB 0.4s | |
=> => extracting sha256:89d9c30c1d48bac627e5c6cb0d1ed1eec28e7dbdfbcc04712e4c79c0f83faf17 0.8s | |
=> [linux/arm64 2/3] RUN uname -a > /myname 1.4s | |
=> [linux/amd64 2/3] RUN uname -a > /myname 1.3s | |
=> [linux/amd64 3/3] COPY Dockerfile / 0.2s | |
=> [linux/arm64 3/3] COPY Dockerfile / 0.2s | |
=> exporting to image 0.5s | |
=> => exporting layers 0.3s | |
=> => exporting manifest sha256:6742b1006d8156877d4ae784d2f6eed1865a6f216b3ceca8c7ba6efaf1c572a3 0.0s | |
=> => exporting config sha256:a28ec7424660e6271b23b6ca0fc0624109ee8b34b15bbae5c78d1ed36ea90286 0.0s | |
=> => exporting manifest sha256:6c5bfe8e600431f3bc85601aa4056081a68bf0abff0a442e659a87f8a087e975 0.0s | |
=> => exporting config sha256:b82b9bd4e314a99b3c6759a914e3d43114e4cca4c8380dbc92f00e83a2bc1d47 0.0s | |
=> => exporting manifest list sha256:376aa2cb10a4901448afa9054b45e58e0e13a69f524dbc0bd0db2788a99ce33c 0.0s | |
=> => naming to docker.io/library/foo:latest 0.0s | |
root@dev3:/tmp/foo# docker images | |
REPOSITORY TAG IMAGE ID CREATED SIZE | |
foo latest 376aa2cb10a4 4 seconds ago 0B | |
root@dev3:/tmp/foo# docker run -it foo uname -a | |
Linux dabbb155a6c7 4.19.0-0.bpo.1-amd64 #1 SMP Debian 4.19.12-1~bpo9+1 (2018-12-30) x86_64 Linux | |
root@dev3:/tmp/foo# docker run -it --platform=linux/arm64 foo uname -a | |
Linux 80cd7b6732be 4.19.0-0.bpo.1-amd64 #1 SMP Debian 4.19.12-1~bpo9+1 (2018-12-30) aarch64 Linux | |
root@dev3:/tmp/foo# | |
root@dev3:/tmp/foo# docker run -it --platform=linux/arm64 foo cat /myname | |
Linux buildkitsandbox 4.19.0-0.bpo.1-amd64 #1 SMP Debian 4.19.12-1~bpo9+1 (2018-12-30) aarch64 Linux | |
root@dev3:/tmp/foo# docker run -it --platform=linux/amd64 foo cat /myname | |
Linux buildkitsandbox 4.19.0-0.bpo.1-amd64 #1 SMP Debian 4.19.12-1~bpo9+1 (2018-12-30) x86_64 Linux | |
root@dev3:/tmp/foo# | |
root@dev3:/tmp/foo# docker build --platform=linux/amd64,linux/arm64 -t tonistiigi/foo -o type=oci,dest=- . | tar xv | |
[+] Building 1.3s (12/12) FINISHED | |
=> [internal] load build definition from Dockerfile 0.0s | |
=> => transferring dockerfile: 31B 0.0s | |
=> [internal] load .dockerignore 0.1s | |
=> => transferring context: 2B 0.0s | |
=> [linux/arm64 internal] load metadata for docker.io/library/alpine:latest 0.3s | |
=> [linux/amd64 internal] load metadata for docker.io/library/alpine:latest 0.3s | |
=> [linux/arm64 1/3] FROM docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 0.0s | |
=> [internal] load build context 0.0s | |
=> => transferring context: 31B 0.0s | |
=> [linux/amd64 1/3] FROM docker.io/library/alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a 0.0s | |
=> CACHED [linux/amd64 2/3] RUN uname -a > /myname 0.0s | |
=> CACHED [linux/amd64 3/3] COPY Dockerfile / 0.0s | |
=> CACHED [linux/arm64 2/3] RUN uname -a > /myname 0.0s | |
=> CACHED [linux/arm64 3/3] COPY Dockerfile / 0.0s | |
=> exporting to oci image format 0.9s | |
=> => exporting layers 0.0s | |
=> => exporting manifest sha256:d73aa995103541d1d334d8db9e56e18fd1c2b123750bdb73bdb68c034a3a23a2 0.0s | |
=> => exporting config sha256:a28ec7424660e6271b23b6ca0fc0624109ee8b34b15bbae5c78d1ed36ea90286 0.0s | |
=> => exporting manifest sha256:279ace68032a2d2dd3f5e1a4a3e554f0cbfff6bab6f96d9b025afafaeb8c5cad 0.0s | |
=> => exporting config sha256:b82b9bd4e314a99b3c6759a914e3d43114e4cca4c8380dbc92f00e83a2bc1d47 0.0s | |
=> => exporting manifest list sha256:207ee34bf379e2db0c912beb79372ca9ff548ff051b43892bc7043a09ed2d00d 0.0s | |
=> => sending tarball 0.7s | |
root@dev3:/tmp/foo# cat index.json | jq . | |
{ | |
"schemaVersion": 2, | |
"manifests": [ | |
{ | |
"mediaType": "application/vnd.oci.image.index.v1+json", | |
"digest": "sha256:207ee34bf379e2db0c912beb79372ca9ff548ff051b43892bc7043a09ed2d00d", | |
"size": 703, | |
"annotations": { | |
"io.containerd.image.name": "docker.io/tonistiigi/foo:latest", | |
"org.opencontainers.image.created": "2019-11-07T01:15:01Z", | |
"org.opencontainers.image.ref.name": "latest" | |
} | |
} | |
] | |
} | |
root@dev3:/tmp/foo# cat blobs/sha256/207ee34bf379e2db0c912beb79372ca9ff548ff051b43892bc7043a09ed2d00d | |
{ | |
"mediaType": "application/vnd.oci.image.index.v1+json", | |
"schemaVersion": 2, | |
"manifests": [ | |
{ | |
"mediaType": "application/vnd.oci.image.manifest.v1+json", | |
"digest": "sha256:d73aa995103541d1d334d8db9e56e18fd1c2b123750bdb73bdb68c034a3a23a2", | |
"size": 908, | |
"platform": { | |
"architecture": "amd64", | |
"os": "linux" | |
} | |
}, | |
{ | |
"mediaType": "application/vnd.oci.image.manifest.v1+json", | |
"digest": "sha256:279ace68032a2d2dd3f5e1a4a3e554f0cbfff6bab6f96d9b025afafaeb8c5cad", | |
"size": 908, | |
"platform": { | |
"architecture": "arm64", | |
"os": "linux" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment