1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
3- docker run --rm --privileged multiarch/qemu-user-static:register --reset
3+ # Login into docker
44docker login --username $DOCKER_USER --password $DOCKER_PASSWORD
5- docker build -t zeerorg/cron-connector:$TRAVIS_TAG .
6- docker push zeerorg/cron-connector:$TRAVIS_TAG
7- docker build -t zeerorg/cron-connector:$TRAVIS_TAG -arm -f Dockerfile.armhf .
8- docker push zeerorg/cron-connector:$TRAVIS_TAG -arm
5+
6+ # Build for amd64 and push
7+ buildctl build --frontend dockerfile.v0 \
8+ --local dockerfile=. \
9+ --local context=. \
10+ --exporter image \
11+ --exporter-opt name=docker.io/zeerorg/cron-connector:${TRAVIS_TAG} -amd64 \
12+ --exporter-opt push=true \
13+ --frontend-opt platform=linux/amd64 \
14+ --frontend-opt filename=./Dockerfile
15+
16+
17+ # Build for armhf and push
18+ buildctl build --frontend dockerfile.v0 \
19+ --local dockerfile=. \
20+ --local context=. \
21+ --exporter image \
22+ --exporter-opt name=docker.io/zeerorg/cron-connector:${TRAVIS_TAG} -arm \
23+ --exporter-opt push=true \
24+ --frontend-opt platform=linux/armhf \
25+ --frontend-opt filename=./Dockerfile.armhf
26+
27+
28+ export DOCKER_CLI_EXPERIMENTAL=enabled
29+
30+ # Create manifest list and push that
31+ docker manifest create zeerorg/cron-connector:${TRAVIS_TAG} \
32+ zeerorg/cron-connector:${TRAVIS_TAG} -amd64 \
33+ zeerorg/cron-connector:${TRAVIS_TAG} -arm
34+
35+ docker manifest annotate zeerorg/cron-connector:${TRAVIS_TAG} zeerorg/cron-connector:${TRAVIS_TAG} -arm --arch arm
36+ docker manifest annotate zeerorg/cron-connector:${TRAVIS_TAG} zeerorg/cron-connector:${TRAVIS_TAG} -amd64 --arch amd64
37+
38+ docker manifest push zeerorg/cron-connector:${TRAVIS_TAG}
0 commit comments