-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuildx.sh
executable file
·32 lines (23 loc) · 1.22 KB
/
buildx.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
#!/usr/bin/env sh
#shellcheck shell=sh
set -xe
REPO=mikenye
IMAGE=adsbhub
PLATFORMS="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64"
docker context use x86_64
export DOCKER_CLI_EXPERIMENTAL="enabled"
docker buildx use homecluster
# Build & push latest
docker buildx build --no-cache -t "${REPO}/${IMAGE}:latest" --compress --push --platform "${PLATFORMS}" .
# Get piaware version from latest
docker pull "${REPO}/${IMAGE}:latest"
VERSION=$(docker run --rm --entrypoint cat ${REPO}/${IMAGE}:latest /usr/bin/adsbhub.sh | grep -i version | head -1 | cut -d ':' -f 2 | tr -d ' ')
# Build & push version-specific
docker buildx build -t "${REPO}/${IMAGE}:${VERSION}" --compress --push --platform "${PLATFORMS}" .
# BUILD NOHEALTHCHECK VERSION
# Modify dockerfile to remove healthcheck
# sed '/^HEALTHCHECK /d' < Dockerfile > Dockerfile.nohealthcheck
# # Build & push latest
# docker buildx build -f Dockerfile.nohealthcheck -t ${REPO}/${IMAGE}:latest_nohealthcheck --compress --push --platform "${PLATFORMS}" .
# # If there are version differences, build & push with a tag matching the build date
# docker buildx build -f Dockerfile.nohealthcheck -t "${REPO}/${IMAGE}:${VERSION}_nohealthcheck" --compress --push --platform "${PLATFORMS}" .