Skip to content
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

Publish arm docker container as well as amd64 #314

Open
cerebrate opened this issue May 29, 2020 · 12 comments · May be fixed by #323
Open

Publish arm docker container as well as amd64 #314

cerebrate opened this issue May 29, 2020 · 12 comments · May be fixed by #323

Comments

@cerebrate
Copy link

Should hopefully be simple enough; it builds just fine using the existing Dockerfile (to https://hub.docker.com/repository/docker/cerebrate/beehive , for example), but it would be good to have an official image that keeps pace with releases.

@rhnvrm
Copy link

rhnvrm commented Jun 14, 2020

+1 to this request. I would be happy to contribute to getting this integrated in the release script as well.

A few observations,

docker buildx build \
     --progress plain \
    --platform=linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x \
    -t $DOCKER_REPO:$TAG \
    --push \
    .

@muesli
Copy link
Owner

muesli commented Jun 14, 2020

* I assume, https://hub.docker.com/r/fribbledom/beehive, is now being pushed to manually by @muesli

Correct, I'm currently running docker build and push manually after pushing a new release.

* Maybe, we could try the following: https://medium.com/@quentin.mcgaw/cross-architecture-docker-builds-with-travis-ci-arm-s390x-etc-8f754e20aaef via travis with `on.tags: true`

I'm currently trying to move away from TravisCI, which sadly has become just too unreliable. We could achieve something similar with GitHub Actions, of course, but I think ideally we integrate this with goreleaser. Contributions are more than welcome here! ❤️

@rhnvrm
Copy link

rhnvrm commented Jun 14, 2020

Hey

I'm not familiar with Github Actions but I've attempted to add the docker buildx step to release.sh here: rhnvrm@84725cb

I was able to push to docker hub with multiple archs: https://hub.docker.com/r/rhnvrm/beehive/tags

For setting up buildx with multi arch you will need to do the following locally:

  1. Add {"experimental":"enabled"} to /etc/docker/daemon.json and $HOME/.docker/config.json and restart docker sudo service docker start
  2. Enable multi-arch builder
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name xbuilder --use

If you think this is enough, I can send a PR.

@rhnvrm rhnvrm linked a pull request Jun 16, 2020 that will close this issue
@rhnvrm
Copy link

rhnvrm commented Aug 14, 2020

Found this recently,

https://github.com/crazy-max/ghaction-docker-buildx

Should we try adding this?

@muesli
Copy link
Owner

muesli commented Aug 17, 2020

@rhnvrm Haven't tried docker-buildx before, but sounds intriguing. Isn't offering Docker Hub a similar integration, though? I'll have to read up on that.

@rhnvrm
Copy link

rhnvrm commented Aug 19, 2020

Hey, just read a bit more about this. Docker Hub also seems to provide it with pre/post hooks.

This repo shows how it can be done:

https://github.com/ckulka/docker-multi-arch-example
https://hub.docker.com/r/ckulka/multi-arch-example

It seems to rely on https://github.com/estesp/manifest-tool

Both methods have their merits.

One benefit, of setting up using buildx, might be that we can have a relatively easier way to build and push from local (if needed).

@muesli
Copy link
Owner

muesli commented Aug 19, 2020

Another option would be using the already existing goreleaser setup (see .goreleaser.yml) to publish Docker builds. That would actually heavily improve and simplify the entire release process.

@rhnvrm
Copy link

rhnvrm commented Aug 19, 2020

I had explored this option as well but landed on goreleaser/goreleaser#530

@mhzawadi
Copy link

mhzawadi commented Oct 1, 2020

Hello,
Any news on this? would love to have a play, but only have pis at home

@rhnvrm
Copy link

rhnvrm commented Oct 1, 2020

It seems like the docker-buildx repo I had linked earlier has been moved under docker organization

https://github.com/docker/setup-buildx-action

I can give it a try with a new PR. What do you say @muesli ?

@muesli
Copy link
Owner

muesli commented Oct 1, 2020

@rhnvrm Yeah, go ahead ❤️ Since goreleaser support is still WIP I'd say we should explore this route.

@rhnvrm
Copy link

rhnvrm commented Nov 6, 2020

@muesli I have updated #323

For testing, I created a dummy tag and pushed it in my fork: https://hub.docker.com/repository/docker/rhnvrm/beehive/tags?page=1

After merging, any tag pushed will be pushed to your dockerhub.

Two secrets will need to be set up:

DOCKERHUB_USERNAME
DOCKERHUB_TOKEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants