Skip to content

Support for multi-platform builds - #18

Closed
Juan Zuluaga (juzuluag) wants to merge 7 commits into
devcontainers:mainfrom
juzuluag:juzuluag/multi_build_support
Closed

Support for multi-platform builds#18
Juan Zuluaga (juzuluag) wants to merge 7 commits into
devcontainers:mainfrom
juzuluag:juzuluag/multi_build_support

Conversation

@juzuluag

@juzuluag Juan Zuluaga (juzuluag) commented May 18, 2022

Copy link
Copy Markdown
Contributor

Work Item ID

Description


Enhance devcontainer CLI build command by adding an option to build multi-platform container images and to push them to a container registry.

devcontainer build command will be enhanced with the following arguments:
--buildx enable to use buildx arguments [boolean][default: false]
--platform value1, value2. Comma delimited string with platform types [string].
i.e. value: linux/amd64,linux/arm64
--push push to a container registry [boolean] [default: false]
--load load builded image to images [boolean] [default: false]

PR Checklist


  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran the lint checks which produced no new errors nor warnings for my changes.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.

Does this introduce a breaking change?


  • Yes
  • No

If this introduces a breaking change, please describe the impact and migration path for existing applications below.

Testing

  • What OS was used for testing: Window and MacOS
  • Which test sets were used: mocka and manual testing
  • Description of test scenarios that you have tried.
    manual: Build images and upload them to container registry (docker hub)

Manual testing:

node devcontainer.js build --workspace-folder ../demo_container/ --buildx --platform linux/arm64,linux/amd64 --push --image-name dockerhubuname/test1:v1

[+] Building 1.9s (9/9) FINISHED                                                
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 245B                                       0.0s
...
 => => pushing manifest for docker.io/dockerhubuname/test1:v1@sha256:00b62d3859  0.4s
 => [auth] dockerhubuname/test1:pull,push token for registry-1.docker.io         0.0s
 => [auth] dockerhubuname/test1:pull,push token for registry-1.docker.io         0.0s

List manifest from container registry

docker buildx imagetools inspect dockerhubuname/test1:v1
Name:      docker.io/dockerhubuname/test1:v1
MediaType: application/vnd.docker.distribution.manifest.list.v2+json
Digest:    sha256:00b62d385953096b5b09ba1458d0e2467b53b3c6d2409958a67eabd68f4fa0a0
           
Manifests: 
  Name:      docker.io/dockerhubuname/test1:v1@sha256:a18591ab9c4d416b9ee5b86c1b66c5ff9b89f8b8b522bc3d26db1395bd736f34
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm64
             
  Name:      docker.io/dockerhubuname/test1:v1@sha256:4ae8b07ea9a8c61da4a06548d758fc27709408b79d52d293bdc0edb940041576
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/amd64

Other information or known dependencies


n/a

@juzuluag

Copy link
Copy Markdown
Contributor Author

Closing since too many conflicts after merge. Replaced with #24

@juzuluag
Juan Zuluaga (juzuluag) deleted the juzuluag/multi_build_support branch June 22, 2022 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant