-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathpush.sh
executable file
·38 lines (30 loc) · 841 Bytes
/
push.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
#!/bin/sh
BUILDER=ipv6nat-builder
DIST_DIR=dist
VERSION="${1}"
if [ -z "${VERSION}" ]
then
echo "Usage: ${0} X.X.X"
exit 1
fi
export DOCKER_HOST=
export DOCKER_CONTEXT=default
cd `dirname "${0}"`
set -e
set -x
docker buildx rm "${BUILDER}" || true
docker buildx create --name "${BUILDER}" --use
docker buildx build \
--platform "linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7" \
--pull \
--push \
--tag "robbertkl/ipv6nat:${VERSION}" \
--tag "robbertkl/ipv6nat:latest" \
.
BUILDER_CONTAINER="buildx_buildkit_${BUILDER}0"
docker exec "${BUILDER_CONTAINER}" sh -c \
'mkdir /dist; mv /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/*/fs/docker-ipv6nat.* /dist'
rm -Rf "${DIST_DIR}/"
docker cp "${BUILDER_CONTAINER}:/dist" "${DIST_DIR}"
docker buildx use default
docker buildx rm "${BUILDER}"