elgohr / Publish-Docker-Github-Action

A Github Action used to build and publish Docker images
MIT License
781 stars 209 forks source link

[FEATURE] build multi-arch image #106

Closed dragoneena12 closed 2 years ago

dragoneena12 commented 4 years ago

Is your feature request related to a problem? Please describe. This Action seems to be able to publish only amd64 image. I want multi-arch image(i.e. armhf or arm64).

Describe the solution you'd like I think we can use docker buildx.

elgohr commented 4 years ago

At the moment you could use a self-hosted runner, but I agree that this would be a great feature.

dragoneena12 commented 4 years ago

ty! I'll work on this.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sundowndev commented 3 years ago

Would love to get that feature too, did you get to dig into this @dragoneena12 ?

dragoneena12 commented 3 years ago

@sundowndev Now I'm using docker/build-push-action instead.

elgohr commented 3 years ago

Sorry, didn't see that this was auto-closed.

elgohr commented 3 years ago

Please give it a try: https://github.com/elgohr/Publish-Docker-Github-Action/releases/tag/3.03 I'm not sure about pushing the images at the moment - as I found no documentation. Need to investigate whether -push in docker buildx build is necessary or whether this could also be done by using good old docker push.

a1300 commented 3 years ago

@elgohr I am running this action with elgohr/Publish-Docker-Github-Action@master I tried running this on ubuntu-18.04 and ubuntu-20.04. Both times I got the error

dd: can't open '/etc/docker/daemon.json': No such file or directory

I used the new property platforms: linux/amd64,linux/arm64. I am hesitant to share the full config due to security considerations.

Do I need to do an extra setup to make docker buildx and platforms work?

elgohr commented 3 years ago

Hey @a1300 , will have a look. Do you get this for both Ubuntu versions?

a1300 commented 3 years ago

@elgohr yes on both ubuntu versions

a1300 commented 3 years ago

@elgohr do you know an example project that uses the new platforms option ?

elgohr commented 3 years ago

At the moment this feature is in beta (see Release Notes). In this way I'm still exploring the field. Looks like we got some challenge here : https://github.com/actions/virtual-environments/issues/3090

elgohr commented 3 years ago

Sorry to say that I reverted this for now (https://github.com/elgohr/Publish-Docker-Github-Action/commit/184d5f4bcf6035e441545968457b61f820efe1c1). At the moment I have not that much time for tinkering (as you can see in the other issue, it's just tinkering). I don't want this action to promise something that is broken.

I also increased the time for issues not becoming stale https://github.com/elgohr/Publish-Docker-Github-Action/commit/be0a327a5b402db8600d8d2afa83ecc23b2d9a6e

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

elgohr commented 2 years ago

Finally I managed to recover some time. Would be great if you could beta test

- name: Publish to Registry
      uses: elgohr/Publish-Docker-Github-Action@multiarch
      with:
        name: myDocker/repository
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        platforms: linux/amd64,linux/arm64
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

elgohr commented 2 years ago

Please have a look at https://github.com/elgohr/Publish-Docker-Github-Action#platforms

mcpierce commented 1 year ago

I'm trying this feature and am not having luck: it's only publishing a linux/amd64 image and I would love to have linux/arm64 as well. Any suggestions?

elgohr commented 1 year ago

@mcpierce could you please provide your configuration?

mcpierce commented 1 year ago

@elgohr I spent some time last night working on this issue in my project and found an alternative path for publishing multi platform. Thanks for the quick response.