-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·19 lines (13 loc) · 849 Bytes
/
build.sh
File metadata and controls
executable file
·19 lines (13 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh -x
IMG="desktopcontainers/base-debian"
PLATFORM="linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6"
if [ -z ${DEBIAN_VERSION+x} ] ; then
docker-compose build -q --pull --no-cache
export DEBIAN_VERSION=$(docker run --rm -ti "$IMG" cat /etc/debian_version | tail -n1 | tr -d '\r')
fi
if echo "$@" | grep -v "force" 2>/dev/null >/dev/null; then
echo "check if image was already build and pushed - skip check on release version"
echo "$@" | grep -v "release" && docker pull "$IMG:d$DEBIAN_VERSION" 2>/dev/null >/dev/null && echo "image already build" && exit 1
fi
docker buildx build -q --pull --no-cache --platform "$PLATFORM" -t "$IMG:d$DEBIAN_VERSION" --push .
echo "$@" | grep "release" 2>/dev/null >/dev/null && echo ">> releasing new latest" && docker buildx build -q --pull --platform "$PLATFORM" -t "$IMG:latest" --push .