From 95380f9b6d0b553035b24b1f90401934c643aa77 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 17 Sep 2024 11:43:13 -0600 Subject: [PATCH 01/14] feature: add how-to for multiple architecture Signed-off-by: Terry Howe --- .../how_to_guides/multiarch.mdx | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx new file mode 100644 index 00000000..2399e683 --- /dev/null +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -0,0 +1,130 @@ +--- +title: Multiple Architecture Image Support +sidebar_position: 110 +--- + +# Multiple Architecture Image/Artifact Support with ORAS + +ORAS can help you manage multiple architecture artifacts such as configurations, executables, and container images. +This example shows how you can use ORAS to manage executables for different operating systems and architectures. + +## Pushing the artifacts +The first step is to push the artifacts to your container registry. + +First we push a Linux ARM64 executable: +```shell +% oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream +✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms + └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab +✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s + └─ sha256:d6f56bc20064075ce319ac2e6fcef5de9ea21773b0a8a4398c4405222971f9c0 +✓ Uploaded application/vnd.oci.image.manifest.v1+json 581/581 B 100.00% 0s + └─ sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd +Pushed [registry] localhost:15000/oras:linux +Tagged arm64 +ArtifactType: application/vnd.oci.image.config.v1+json +Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd +``` + +Next, we push a Linux AMD64 executable: +```shell +% oras push --plain-http localhost:15000/oras:linux,amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream +✓ Uploaded bin/linux/amd64/oras 11/11 MB 100.00% 0s + └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e +✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s + └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf +✓ Uploaded application/vnd.oci.image.manifest.v1+json 581/581 B 100.00% 0s + └─ sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +Pushed [registry] localhost:15000/oras:linux +Tagged amd64 +ArtifactType: application/vnd.oci.image.config.v1+json +Digest: sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +``` +This example pushes the executable for two architectures, but you could also push artifacts with a different operating system or other platform attribute. + +## Create a multiple architecture manifest + +After you have pushed all your platform specific artifacts, create a manifest referencing them: +```shell +% oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +Fetching sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd +Fetched sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd +Fetching sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +Fetched sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +Packed 0fd4ac889c6f application/vnd.oci.image.index.v1+json +Pushed [registry] localhost:15000/oras:v1 +Digest: sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 +``` + +## Download your platform specific artifact + +Pull the artifact to that directory: +```shell +% oras pull --plain-http localhost:15000/oras:v1 --platform linux/amd64 -o ./download +✓ Skipped application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s + └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf +✓ Pulled bin/linux/amd64/oras 11/11 MB 100.00% 19ms + └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e +✓ Pulled application/vnd.oci.image.manifest.v1+json 581/581 B 100.00% 81µs + └─ sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +Skipped pulling layers without file name in "org.opencontainers.image.title" +Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all layers. +``` + +Validate your download +```shell +% file download/bin/linux/amd64/oras +download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=g5htPJf4jOBYObk8HPGK/C_STgrrtpidMtnOXIshh/AwKGiCqqgvmy7kvjXixL/hvqsAg3dicj7a6T6waJe, not stripped +% sha256sum ./download/bin/linux/amd64/oras +4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ./download/bin/linux/amd64/oras +``` + +## Update your multiple architecture manifest + +You can also update your manifest if you want to add a new artifact. +For example, say you created an executable for Darwin, push the executable: +```shell +% oras push --plain-http localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream +✓ Exists bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 0s + └─ sha256:a839f5d9cd3502b87b8d8edca31cd9f6f66c4835364e73b87a1645353631590f +✓ Exists application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s + └─ sha256:e9302bbb2fb8f6c2df866d3c4e41917849442f89a575f36f43366a7279804f70 +✓ Uploaded application/vnd.oci.image.manifest.v1+json 589/589 B 100.00% 0s + └─ sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Pushed [registry] localhost:15000/oras:darwin +Tagged amd64 +ArtifactType: application/vnd.oci.image.config.v1+json +Digest: sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +```` + +Add it to your manifest: +```shell +% oras manifest index update --plain-http localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Fetching v1 +Fetched sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 v1 +Fetching sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Fetched sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Added sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Updated sha256:a694281dcf1248049c3d43e55d88ad1276c90b2b92f9b7d964fcc18e1fab7eb7 +Pushed [registry] localhost:15000/oras:v1 +Digest: sha256:a694281dcf1248049c3d43e55d88ad1276c90b2b92f9b7d964fcc18e1fab7eb7 +``` + +Download your new referenced executable: +```shell +% oras pull --plain-http localhost:15000/oras:v1 --platform darwin/amd64 -o ./download +✓ Skipped application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s + └─ sha256:e9302bbb2fb8f6c2df866d3c4e41917849442f89a575f36f43366a7279804f70 +✓ Pulled bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 30ms + └─ sha256:a839f5d9cd3502b87b8d8edca31cd9f6f66c4835364e73b87a1645353631590f +✓ Pulled application/vnd.oci.image.manifest.v1+json 589/589 B 100.00% 132µs + └─ sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +Skipped pulling layers without file name in "org.opencontainers.image.title" +Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all layers. +``` + +Validate the executable: +```shell +% file download/bin/darwin/amd64/oras +download/bin/darwin/amd64/oras: Mach-O 64-bit executable x86_64 +``` From 1316c5c8fef9050931ed6c7597482dcfba49f373 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:01:53 -0700 Subject: [PATCH 02/14] Update versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx Co-authored-by: Feynman Zhou Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 2399e683..684b8749 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -5,7 +5,7 @@ sidebar_position: 110 # Multiple Architecture Image/Artifact Support with ORAS -ORAS can help you manage multiple architecture artifacts such as configurations, executables, and container images. +ORAS can help you create and manage multi-architecture artifacts such as configurations, executables, and container images. This example shows how you can use ORAS to manage executables for different operating systems and architectures. ## Pushing the artifacts From 8417efb3acd0c3b7d7c36fd5afefdabc471b8936 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:02:05 -0700 Subject: [PATCH 03/14] Update versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx Co-authored-by: Feynman Zhou Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 684b8749..c3e1fbc4 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -9,7 +9,7 @@ ORAS can help you create and manage multi-architecture artifacts such as configu This example shows how you can use ORAS to manage executables for different operating systems and architectures. ## Pushing the artifacts -The first step is to push the artifacts to your container registry. +The first step is to push the artifact with platform information to your container registry. First we push a Linux ARM64 executable: ```shell From 1242dbce374257620bb46515780d7253ee5e0c21 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:02:14 -0700 Subject: [PATCH 04/14] Update versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx Co-authored-by: Shiwei Zhang Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index c3e1fbc4..7e5cbdbe 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -12,7 +12,7 @@ This example shows how you can use ORAS to manage executables for different oper The first step is to push the artifact with platform information to your container registry. First we push a Linux ARM64 executable: -```shell +```console % oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream ✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab From ea884fb10004e9fc6bdf3cb4cb19837d040f46db Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:02:26 -0700 Subject: [PATCH 05/14] Update versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx Co-authored-by: Shiwei Zhang Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 7e5cbdbe..8af8b2a9 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -13,7 +13,7 @@ The first step is to push the artifact with platform information to your contain First we push a Linux ARM64 executable: ```console -% oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream +% oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream ✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s From 35ecf17db74301e21c14e099ee4d02b583fda981 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:02:53 -0700 Subject: [PATCH 06/14] Update versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx Co-authored-by: Feynman Zhou Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 8af8b2a9..5baab853 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -44,7 +44,7 @@ This example pushes the executable for two architectures, but you could also pus ## Create a multiple architecture manifest -After you have pushed all your platform specific artifacts, create a manifest referencing them: +After you have pushed all your platform specific artifacts, create a manifest referencing them using the OCI image index format: ```shell % oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 Fetching sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd From a4869eef108c0737281ed9ead44aa87524acdcb5 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:06:04 -0700 Subject: [PATCH 07/14] Use console for shell examples Signed-off-by: Terry Howe --- .../how_to_guides/multiarch.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 5baab853..d915f738 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -27,7 +27,7 @@ Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd ``` Next, we push a Linux AMD64 executable: -```shell +```console % oras push --plain-http localhost:15000/oras:linux,amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream ✓ Uploaded bin/linux/amd64/oras 11/11 MB 100.00% 0s └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e @@ -45,7 +45,7 @@ This example pushes the executable for two architectures, but you could also pus ## Create a multiple architecture manifest After you have pushed all your platform specific artifacts, create a manifest referencing them using the OCI image index format: -```shell +```console % oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 Fetching sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Fetched sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd @@ -59,7 +59,7 @@ Digest: sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 ## Download your platform specific artifact Pull the artifact to that directory: -```shell +```console % oras pull --plain-http localhost:15000/oras:v1 --platform linux/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf @@ -72,7 +72,7 @@ Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all ``` Validate your download -```shell +```console % file download/bin/linux/amd64/oras download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=g5htPJf4jOBYObk8HPGK/C_STgrrtpidMtnOXIshh/AwKGiCqqgvmy7kvjXixL/hvqsAg3dicj7a6T6waJe, not stripped % sha256sum ./download/bin/linux/amd64/oras @@ -83,7 +83,7 @@ download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYS You can also update your manifest if you want to add a new artifact. For example, say you created an executable for Darwin, push the executable: -```shell +```console % oras push --plain-http localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream ✓ Exists bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 0s └─ sha256:a839f5d9cd3502b87b8d8edca31cd9f6f66c4835364e73b87a1645353631590f @@ -98,7 +98,7 @@ Digest: sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 ```` Add it to your manifest: -```shell +```console % oras manifest index update --plain-http localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 Fetching v1 Fetched sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 v1 @@ -111,7 +111,7 @@ Digest: sha256:a694281dcf1248049c3d43e55d88ad1276c90b2b92f9b7d964fcc18e1fab7eb7 ``` Download your new referenced executable: -```shell +```console % oras pull --plain-http localhost:15000/oras:v1 --platform darwin/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s └─ sha256:e9302bbb2fb8f6c2df866d3c4e41917849442f89a575f36f43366a7279804f70 @@ -124,7 +124,7 @@ Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all ``` Validate the executable: -```shell +```console % file download/bin/darwin/amd64/oras download/bin/darwin/amd64/oras: Mach-O 64-bit executable x86_64 ``` From c1242721134fe82a7886ba6f04f4fc0cbace1c3f Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:10:37 -0700 Subject: [PATCH 08/14] Consistently use multi-architecture Signed-off-by: Terry Howe --- .../version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index d915f738..00f4c7f9 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -1,9 +1,9 @@ --- -title: Multiple Architecture Image Support +title: Multi-Architecture Image/Artifact Support sidebar_position: 110 --- -# Multiple Architecture Image/Artifact Support with ORAS +# Multi-Architecture Image/Artifact Support with ORAS ORAS can help you create and manage multi-architecture artifacts such as configurations, executables, and container images. This example shows how you can use ORAS to manage executables for different operating systems and architectures. @@ -42,7 +42,7 @@ Digest: sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 ``` This example pushes the executable for two architectures, but you could also push artifacts with a different operating system or other platform attribute. -## Create a multiple architecture manifest +## Create a multi-architecture manifest After you have pushed all your platform specific artifacts, create a manifest referencing them using the OCI image index format: ```console @@ -79,7 +79,7 @@ download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYS 4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ./download/bin/linux/amd64/oras ``` -## Update your multiple architecture manifest +## Update your multi-architecture manifest You can also update your manifest if you want to add a new artifact. For example, say you created an executable for Darwin, push the executable: From 2060a7375522b1464a5fae212306fd4006e772d7 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:11:37 -0700 Subject: [PATCH 09/14] Consistently use normal Linux shell prompt Signed-off-by: Terry Howe --- .../how_to_guides/multiarch.mdx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 00f4c7f9..80dae03c 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -13,7 +13,7 @@ The first step is to push the artifact with platform information to your contain First we push a Linux ARM64 executable: ```console -% oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream +$ oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream ✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s @@ -28,7 +28,7 @@ Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Next, we push a Linux AMD64 executable: ```console -% oras push --plain-http localhost:15000/oras:linux,amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream +$ oras push --plain-http localhost:15000/oras:linux,amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream ✓ Uploaded bin/linux/amd64/oras 11/11 MB 100.00% 0s └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s @@ -46,7 +46,7 @@ This example pushes the executable for two architectures, but you could also pus After you have pushed all your platform specific artifacts, create a manifest referencing them using the OCI image index format: ```console -% oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +$ oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 Fetching sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Fetched sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Fetching sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 @@ -60,7 +60,7 @@ Digest: sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 Pull the artifact to that directory: ```console -% oras pull --plain-http localhost:15000/oras:v1 --platform linux/amd64 -o ./download +$ oras pull --plain-http localhost:15000/oras:v1 --platform linux/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf ✓ Pulled bin/linux/amd64/oras 11/11 MB 100.00% 19ms @@ -73,9 +73,9 @@ Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all Validate your download ```console -% file download/bin/linux/amd64/oras +$ file download/bin/linux/amd64/oras download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=g5htPJf4jOBYObk8HPGK/C_STgrrtpidMtnOXIshh/AwKGiCqqgvmy7kvjXixL/hvqsAg3dicj7a6T6waJe, not stripped -% sha256sum ./download/bin/linux/amd64/oras +$ sha256sum ./download/bin/linux/amd64/oras 4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ./download/bin/linux/amd64/oras ``` @@ -84,7 +84,7 @@ download/bin/linux/amd64/oras: ELF 64-bit LSB executable, x86-64, version 1 (SYS You can also update your manifest if you want to add a new artifact. For example, say you created an executable for Darwin, push the executable: ```console -% oras push --plain-http localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream +$ oras push --plain-http localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream ✓ Exists bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 0s └─ sha256:a839f5d9cd3502b87b8d8edca31cd9f6f66c4835364e73b87a1645353631590f ✓ Exists application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s @@ -99,7 +99,7 @@ Digest: sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 Add it to your manifest: ```console -% oras manifest index update --plain-http localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +$ oras manifest index update --plain-http localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 Fetching v1 Fetched sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 v1 Fetching sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 @@ -112,7 +112,7 @@ Digest: sha256:a694281dcf1248049c3d43e55d88ad1276c90b2b92f9b7d964fcc18e1fab7eb7 Download your new referenced executable: ```console -% oras pull --plain-http localhost:15000/oras:v1 --platform darwin/amd64 -o ./download +$ oras pull --plain-http localhost:15000/oras:v1 --platform darwin/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s └─ sha256:e9302bbb2fb8f6c2df866d3c4e41917849442f89a575f36f43366a7279804f70 ✓ Pulled bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 30ms @@ -125,6 +125,6 @@ Use 'oras copy localhost:15000/oras:v1 --to-oci-layout ' to pull all Validate the executable: ```console -% file download/bin/darwin/amd64/oras +$ file download/bin/darwin/amd64/oras download/bin/darwin/amd64/oras: Mach-O 64-bit executable x86_64 ``` From 2f098d0c7b19b9af4598563a80d7da9070c26c3c Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 24 Dec 2024 07:15:07 -0700 Subject: [PATCH 10/14] Remove obvious reference in heading Signed-off-by: Terry Howe --- versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 80dae03c..604bd2bf 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -3,7 +3,7 @@ title: Multi-Architecture Image/Artifact Support sidebar_position: 110 --- -# Multi-Architecture Image/Artifact Support with ORAS +# Multi-Architecture Image/Artifact Support ORAS can help you create and manage multi-architecture artifacts such as configurations, executables, and container images. This example shows how you can use ORAS to manage executables for different operating systems and architectures. From ffe8e2f7a4c4987a95b248a30e1294341d31106d Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Fri, 27 Dec 2024 12:12:43 -0700 Subject: [PATCH 11/14] Change tag for linux_amd64 Signed-off-by: Terry Howe --- .../version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 604bd2bf..2983da30 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -13,14 +13,14 @@ The first step is to push the artifact with platform information to your contain First we push a Linux ARM64 executable: ```console -$ oras push --plain-http localhost:15000/oras:linux,arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream +$ oras push --plain-http localhost:15000/oras:linux_arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream ✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s └─ sha256:d6f56bc20064075ce319ac2e6fcef5de9ea21773b0a8a4398c4405222971f9c0 ✓ Uploaded application/vnd.oci.image.manifest.v1+json 581/581 B 100.00% 0s └─ sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd -Pushed [registry] localhost:15000/oras:linux +Pushed [registry] localhost:15000/oras:linux_amd64 Tagged arm64 ArtifactType: application/vnd.oci.image.config.v1+json Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd @@ -28,14 +28,14 @@ Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Next, we push a Linux AMD64 executable: ```console -$ oras push --plain-http localhost:15000/oras:linux,amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream +$ oras push --plain-http localhost:15000/oras:linux_amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream ✓ Uploaded bin/linux/amd64/oras 11/11 MB 100.00% 0s └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf ✓ Uploaded application/vnd.oci.image.manifest.v1+json 581/581 B 100.00% 0s └─ sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 -Pushed [registry] localhost:15000/oras:linux +Pushed [registry] localhost:15000/oras:linux_amd64 Tagged amd64 ArtifactType: application/vnd.oci.image.config.v1+json Digest: sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 From 5266af40cf63f36bf93e1e75aaa8206e0b60f754 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Fri, 27 Dec 2024 15:54:35 -0700 Subject: [PATCH 12/14] Add tag push and manifest fetch Signed-off-by: Terry Howe --- .../how_to_guides/multiarch.mdx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 2983da30..be6e6e89 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -56,6 +56,48 @@ Pushed [registry] localhost:15000/oras:v1 Digest: sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 ``` +You may also create a multi-architecture manifest with tags: +```console +$ oras manifest index create localhost:15000/oras:v1 linux_arm64 linux_amd64 +Fetching linux_arm64 +Fetched sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd linux_arm64 +Fetching linux_amd64 +Fetched sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 linux_amd64 +Packed 0fd4ac889c6f application/vnd.oci.image.index.v1+json +Pushed [registry] localhost:15000/oras:v1 +Digest: sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 +``` + +## View the multi-architecture manifest + +View the generated manifest: +```console +$ oras manifest fetch localhost:15000/oras:v1 --pretty +{ + "schemaVersion": 2, + "mediaType": "application/vnd.oci.image.index.v1+json", + "manifests": [ + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd", + "size": 590, + "platform": { + "architecture": "arm64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4", + "size": 590, + "platform": { + "architecture": "amd64", + "os": "linux" + } + } + ] +} +``` ## Download your platform specific artifact Pull the artifact to that directory: From 9d403e5d1e125ba8caa46fa7a44ce4c55b2abb10 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 14 Jan 2025 11:48:26 -0700 Subject: [PATCH 13/14] clarify shas with env vars Signed-off-by: Terry Howe --- .../version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index be6e6e89..865224e7 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -46,7 +46,9 @@ This example pushes the executable for two architectures, but you could also pus After you have pushed all your platform specific artifacts, create a manifest referencing them using the OCI image index format: ```console -$ oras manifest index create localhost:15000/oras:v1 sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +$ LINUX_ARM64_SHA=sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd +$ LINUX_AMD64_SHA=sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 +$ oras manifest index create localhost:15000/oras:v1 ${LINUX_ARM64_SHA} ${LINUX_AMD64_SHA} Fetching sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Fetched sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Fetching sha256:e5b0ffe309a91893d4423f09e82410364607fd749ea2f93dd1c286d718d9c1e4 From 0cb3cbe2fd5f686df38bc97c579e84114fcba490 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Tue, 14 Jan 2025 11:57:57 -0700 Subject: [PATCH 14/14] get rid of plain-http argument Signed-off-by: Terry Howe --- .../version-1.3.0-beta.1/how_to_guides/multiarch.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx index 865224e7..160ed85b 100644 --- a/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx +++ b/versioned_docs/version-1.3.0-beta.1/how_to_guides/multiarch.mdx @@ -13,7 +13,7 @@ The first step is to push the artifact with platform information to your contain First we push a Linux ARM64 executable: ```console -$ oras push --plain-http localhost:15000/oras:linux_arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream +$ oras push localhost:15000/oras:linux_arm64 --artifact-platform linux/arm64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/arm64/oras:application/octet-stream ✓ Uploaded bin/linux/arm64/oras 10.5/10.5 MB 100.00% 36ms └─ sha256:32374a656f830f5d7504ad06c3c7be025fb38257d6793d8e70fed6f2b753c7ab ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s @@ -28,7 +28,7 @@ Digest: sha256:302df4334cffe5132b6b81c06742be8ab3345bff3ce922662bc8674e79113bfd Next, we push a Linux AMD64 executable: ```console -$ oras push --plain-http localhost:15000/oras:linux_amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream +$ oras push localhost:15000/oras:linux_amd64 --artifact-platform linux/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/linux/amd64/oras:application/octet-stream ✓ Uploaded bin/linux/amd64/oras 11/11 MB 100.00% 0s └─ sha256:4640fefdb4e22eb1308e40d5fac9fd9d16e17dfbc20202bb3ed42033d01d823e ✓ Exists application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s @@ -104,7 +104,7 @@ $ oras manifest fetch localhost:15000/oras:v1 --pretty Pull the artifact to that directory: ```console -$ oras pull --plain-http localhost:15000/oras:v1 --platform linux/amd64 -o ./download +$ oras pull localhost:15000/oras:v1 --platform linux/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 37/37 B 100.00% 0s └─ sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf ✓ Pulled bin/linux/amd64/oras 11/11 MB 100.00% 19ms @@ -128,7 +128,7 @@ $ sha256sum ./download/bin/linux/amd64/oras You can also update your manifest if you want to add a new artifact. For example, say you created an executable for Darwin, push the executable: ```console -$ oras push --plain-http localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream +$ oras push localhost:15000/oras:darwin,amd64 --artifact-platform darwin/amd64 --artifact-type 'application/vnd.oci.image.config.v1+json' bin/darwin/amd64/oras:application/octet-stream ✓ Exists bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 0s └─ sha256:a839f5d9cd3502b87b8d8edca31cd9f6f66c4835364e73b87a1645353631590f ✓ Exists application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s @@ -143,7 +143,7 @@ Digest: sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 Add it to your manifest: ```console -$ oras manifest index update --plain-http localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 +$ oras manifest index update localhost:15000/oras:v1 --add sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 Fetching v1 Fetched sha256:0fd4ac889c6f1f3e4fbb1c88b0cc18b97176bf7fd0841ac9c5264d20dd54e2d8 v1 Fetching sha256:f5758b75ebc4d82280078afb9ebeb859f91a481667c018c9edf91a432518cb20 @@ -156,7 +156,7 @@ Digest: sha256:a694281dcf1248049c3d43e55d88ad1276c90b2b92f9b7d964fcc18e1fab7eb7 Download your new referenced executable: ```console -$ oras pull --plain-http localhost:15000/oras:v1 --platform darwin/amd64 -o ./download +$ oras pull localhost:15000/oras:v1 --platform darwin/amd64 -o ./download ✓ Skipped application/vnd.unknown.config.v1+json 38/38 B 100.00% 0s └─ sha256:e9302bbb2fb8f6c2df866d3c4e41917849442f89a575f36f43366a7279804f70 ✓ Pulled bin/darwin/amd64/oras 11.1/11.1 MB 100.00% 30ms