-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added platform arg to docker build #182
Closed
Closed
Conversation
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
Go ahead and use mine pipeline.
name: Build & Publish Docker Image
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: checkout code
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
-
name: build the image
run: |
docker buildx build \
--push \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/REPO-NAME:TAG \
--platform linux/amd64,linux/arm/v7,linux/arm64 . |
Hi there 👋 I am investigating your proposal and |
@jlandure any updates regarding linux/arm64 image? |
zigarn
reviewed
May 9, 2022
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
set -e | |||
|
|||
docker image build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t $IMAGE_NAME . | |||
docker image build --build-arg VCS_REF=`git rev-parse --short HEAD` --platform linux/arm64,linux/amd64 --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t $IMAGE_NAME . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be?
Suggested change
docker image build --build-arg VCS_REF=`git rev-parse --short HEAD` --platform linux/arm64,linux/amd64 --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t $IMAGE_NAME . | |
docker buildx build --build-arg VCS_REF=`git rev-parse --short HEAD` --platform linux/arm64,linux/amd64 --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t $IMAGE_NAME . |
This was referenced May 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jlandure, thanks a lot for your work!
Here's my PR to open discussion for publishing multi-arch images:
https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ has a quick guide on what I propose. The
docker buildx way
. I have been testing this out and using this extensively to publish multi-arch image to multiple registries.Suggestion - what about using GitHub Actions to publish multi-arch multi-registry images? Here's my repo which implements it this way - https://github.com/drpayyne/docker-php. There's a single workflow file for each package and I build for both
linux/arm64
andlinux/amd64
and publish it to both DockerHub and GitHub Packages.This is a draft PR which I intend to take forward in your preferred way of action. Please let me know how we can do this. From a quick overview, only the Deno Dockerfile needs a little modification to get it to work multi-platform. We need to pick the appropriate Deno download URL based on the target architecture. A preview of how it would be is implemented by me for another repo at https://github.com/markshust/docker-magento/pull/516/files