blob: 4cfdeb175632667bf2f0deba444034f938681e3f (
plain) (
tree)
|
|
# I used a guide to set up multiarch builds [1].
# I don't understand it completely at the moment, but whatever.
# The goal is to have a single multiarch repo on Docker Hub for each of the
# services.
# The approach is to use Docker's new BuildKit builder + the buildx command
# line plugin.
#
# Other possibilities are:
# * use QEMU + multiarch base images directly [2][3], and create a manifest
# file manually,
# * build natively on multiple architectures (not sure how to combine them in
# a single manifest then though).
#
# The disadvantages of the approach taken are:
# * newer Docker version is required,
# * docker-compose doesn't seem to support that method natively.
#
# [1]: https://mirailabs.io/blog/multiarch-docker-with-buildx/
# [2]: https://lobradov.github.io/Building-docker-multiarch-images/
# [3]: https://ownyourbits.com/2018/06/27/running-and-building-arm-docker-containers-in-x86/
# TODO: Docker Hub automated builds instead of Travis?
# TODO: docker-compose instead of docker buildx?
language: minimal
os: linux
dist: bionic
services:
- docker
addons:
apt:
update: true
# Newer docker for buildx support:
sources:
- key_url: 'https://download.docker.com/linux/ubuntu/gpg'
sourceline: 'deb https://download.docker.com/linux/ubuntu "$(lsb_release -cs)" stable'
packages:
- docker-ce
env:
# Enable experimental buildx support
DOCKER_CLI_EXPERIMENTAL: enabled
platforms: linux/i386,linux/amd64,linux/armhf
script:
- docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
- docker buildx create --use
- docker buildx build --platform "$platforms" dump1090/
- docker buildx build --platform "$platforms" fr24feed/
- |-
if [ "$TRAVIS_BRANCH" = master ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker buildx build --platform "$platforms" -t "$DOCKER_USERNAME/dump1090" --push dump1090/
docker buildx build --platform "$platforms" -t "$DOCKER_USERNAME/fr24feed" --push fr24feed/
fi
|