Open cerebrate opened 4 years ago
+1 to this request. I would be happy to contribute to getting this integrated in the release script as well.
A few observations,
docker build
or docker push
inside either tools/release.sh
or travis ci
or the goreleaser
fileson.tags: true
release.sh
)
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 \
.
* 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! :heart:
Hey
I'm not familiar with Github Actions but I've attempted to add the docker buildx
step to release.sh
here: https://github.com/rhnvrm/beehive/commit/84725cb4167f86f7adc2ce17e0519a5b93f51369
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:
{"experimental":"enabled"}
to /etc/docker/daemon.json
and $HOME/.docker/config.json
and restart docker sudo service docker start
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 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.
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).
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.
I had explored this option as well but landed on https://github.com/goreleaser/goreleaser/issues/530
Hello, Any news on this? would love to have a play, but only have pis at home
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 ?
@rhnvrm Yeah, go ahead :heart: Since goreleaser support is still WIP I'd say we should explore this route.
@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
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.