-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-images.sh
56 lines (42 loc) · 2.29 KB
/
build-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# kudos https://dev.to/zeerorg/build-multi-arch-docker-images-on-travis-5428
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
# Build for amd64 and push
buildctl build --frontend dockerfile.v0 \
--local dockerfile=. \
--local context=. \
--output type=image,name=wise2c/openresty-multi-arch:1.17.8-amd64,push=true \
--opt platform=linux/amd64 \
--opt filename=./Dockerfile
# Build for arm64 and push
buildctl build --frontend dockerfile.v0 \
--local dockerfile=. \
--local context=. \
--output type=image,name=wise2c/openresty-multi-arch:1.17.8-arm64,push=true \
--opt platform=linux/arm64 \
--opt filename=./Dockerfile
export DOCKER_CLI_EXPERIMENTAL=enabled
# Create manifest list and push that
# 1.17.8
docker manifest create wise2c/openresty-multi-arch:1.17.8 \
wise2c/openresty-multi-arch:1.17.8-amd64 \
wise2c/openresty-multi-arch:1.17.8-arm64
docker manifest annotate wise2c/openresty-multi-arch:1.17.8 wise2c/openresty-multi-arch:1.17.8-arm64 --arch arm64
docker manifest annotate wise2c/openresty-multi-arch:1.17.8 wise2c/openresty-multi-arch:1.17.8-amd64 --arch amd64
docker manifest push wise2c/openresty-multi-arch:1.17.8
# latest
docker pull wise2c/openresty-multi-arch:1.17.8
docker pull wise2c/openresty-multi-arch:1.17.8-amd64
docker pull wise2c/openresty-multi-arch:1.17.8-arm64
docker tag wise2c/openresty-multi-arch:1.17.8 wise2c/openresty-multi-arch:latest
docker tag wise2c/openresty-multi-arch:1.17.8-amd64 wise2c/openresty-multi-arch:latest-amd64
docker tag wise2c/openresty-multi-arch:1.17.8-arm64 wise2c/openresty-multi-arch:latest-arm64
docker push wise2c/openresty-multi-arch:latest
docker push wise2c/openresty-multi-arch:latest-arm64
docker push wise2c/openresty-multi-arch:latest-amd64
docker manifest create wise2c/openresty-multi-arch:latest \
wise2c/openresty-multi-arch:latest-amd64 \
wise2c/openresty-multi-arch:latest-arm64
docker manifest annotate wise2c/openresty-multi-arch:latest wise2c/openresty-multi-arch:latest-arm64 --arch arm64
docker manifest annotate wise2c/openresty-multi-arch:latest wise2c/openresty-multi-arch:latest-amd64 --arch amd64
docker manifest push wise2c/openresty-multi-arch:latest