-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (29 loc) · 989 Bytes
/
build.sh
File metadata and controls
executable file
·29 lines (29 loc) · 989 Bytes
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
#!/bin/bash
ARCHS=linux/arm64/v8,linux/amd64
TAG=$(date "+%Y.%m.%d")
docker run --privileged --dns=8.8.8.8 --rm tonistiigi/binfmt --install all
if [ -n "$1" ]; then
pushd "$1" || exit
if [ -e .build-archs ]; then
ARCHS=$(cat .build-archs)
fi
docker buildx build --push --platform "$ARCHS" --tag "debenham/${1}:${TAG}" --tag "ghcr.io/cjd/${1}:${TAG}" --tag "debenham/${1}:latest" --tag "ghcr.io/cjd/${1}:latest" .
else
# shellcheck disable=2013
for IMAGE in *; do
if [ -d "$IMAGE" ]; then
pushd "$IMAGE" || exit
if [ -e .skip ]; then
continue
fi
for D in $(grep FROM ./Dockerfile | cut -f2 -d" " | sort -u); do
docker pull "$D"
done
if [ -e .build-archs ]; then
ARCHS=$(cat .build-archs)
fi
docker buildx build --push --platform "$ARCHS" --tag "debenham/${IMAGE}:${TAG}" --tag "ghcr.io/cjd/${IMAGE}:${TAG}" --tag "debenham/${IMAGE}:latest" --tag "ghcr.io/cjd/${IMAGE}:latest" .
popd || exit
fi
done
fi