-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·59 lines (49 loc) · 1.61 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·59 lines (49 loc) · 1.61 KB
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
58
59
#!/bin/bash
# https://github.com/docker/buildx
# Notes on setting up build environment on linux
# https://github.com/docker/buildx/issues/57
# The easiest way to setup qemu should be to run docker run --privileged linuxkit/binfmt:v0.7
usage()
{
echo "This script will push canarypi to dockerhub using a specific version number and update latest tag."
echo "Images will be built for linux/arm64,linux/amd64, and linux/arm/v7"
echo "A version must be specified"
echo "Usage: $0 -v x.x"
}
if [ "$1" == "" ]; then
usage
exit
fi
push()
{
if [ "$version" == "" ]; then
usage
exit
fi
# Create BuildKit
docker buildx create --name canarypi --platform linux/arm64,linux/amd64,linux/arm/v7
docker buildx use canarypi
# Build multi-platform images
docker buildx build --no-cache --platform linux/arm64,linux/amd64,linux/arm/v7 -t macmondev/canarypi:$version --push .
docker buildx build --no-cache --platform linux/arm64,linux/amd64,linux/arm/v7 -t macmondev/canarypi --push .
# echo ==== \$ docker buildx imagetools inspect macmondev/canarypi:0.1
docker buildx imagetools inspect macmondev/canarypi
docker buildx stop canarypi
docker buildx rm canarypi
}
# Main
while [ "$1" != "" ]; do
case $1 in
-v | --version ) shift
version=$1
push
exit
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done