-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·57 lines (48 loc) · 2.33 KB
/
build.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
57
#!/bin/bash
set -xeuf -o pipefail
if [ "$#" != "1" ]; then
echo "Usage: $0 <version>"
exit 1
fi
VERSION="$1"
echo "Building Docker container for $VERSION..."
docker build --no-cache --platform linux/arm/v6 \
--build-arg VERSION=$VERSION \
--build-arg BINARYPLATFORM=linux_arm \
--build-arg BUILDPLATFORM=arm32v6 \
--build-arg RUSTPLATFORM=arm-unknown-linux-musleabi \
-t mmastrac/stylus:latest-arm -f docker/Dockerfile .
docker build --no-cache --platform linux/arm64 \
--build-arg VERSION=$VERSION \
--build-arg BINARYPLATFORM=linux_arm64 \
--build-arg BUILDPLATFORM=arm64v8 \
--build-arg RUSTPLATFORM=aarch64-unknown-linux-musl \
-t mmastrac/stylus:latest-arm64 -f docker/Dockerfile .
docker build --no-cache --platform linux/amd64 \
--build-arg VERSION=$VERSION \
--build-arg BINARYPLATFORM=linux_amd64 \
--build-arg BUILDPLATFORM=amd64 \
--build-arg RUSTPLATFORM=x86_64-unknown-linux-musl \
-t mmastrac/stylus:latest-x86_64 -f docker/Dockerfile .
docker push mmastrac/stylus:latest-arm
docker push mmastrac/stylus:latest-arm64
docker push mmastrac/stylus:latest-x86_64
# TBH I don't fully understand manifests, but this seems to work
rm -rf ~/.docker/manifests/docker.io_mmastrac_stylus-latest
docker manifest create mmastrac/stylus:latest \
mmastrac/stylus:latest-arm \
mmastrac/stylus:latest-arm64 \
mmastrac/stylus:latest-x86_64
docker manifest annotate --os linux --arch arm --variant v6 mmastrac/stylus:latest mmastrac/stylus:latest-arm
docker manifest annotate --os linux --arch arm64 --variant v8 mmastrac/stylus:latest mmastrac/stylus:latest-arm64
docker manifest annotate --os linux --arch amd64 mmastrac/stylus:latest mmastrac/stylus:latest-x86_64
docker manifest push mmastrac/stylus:latest
rm -rf ~/.docker/manifests/docker.io_mmastrac_stylus-$VERSION
docker manifest create mmastrac/stylus:$VERSION \
mmastrac/stylus:latest-arm \
mmastrac/stylus:latest-arm64 \
mmastrac/stylus:latest-x86_64
docker manifest annotate --os linux --arch arm --variant v6 mmastrac/stylus:$VERSION mmastrac/stylus:latest-arm
docker manifest annotate --os linux --arch arm64 --variant v8 mmastrac/stylus:$VERSION mmastrac/stylus:latest-arm64
docker manifest annotate --os linux --arch amd64 mmastrac/stylus:$VERSION mmastrac/stylus:latest-x86_64
docker manifest push mmastrac/stylus:$VERSION