From d6861b4e9334252a72b30c2ac47de90db54ab574 Mon Sep 17 00:00:00 2001 From: Mariano Uvalle Date: Wed, 20 Nov 2024 14:58:23 -0800 Subject: [PATCH] Add dev script for building linux. --- dev/build-linux.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 dev/build-linux.sh diff --git a/dev/build-linux.sh b/dev/build-linux.sh new file mode 100755 index 00000000..42a5f0e4 --- /dev/null +++ b/dev/build-linux.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +if [[ -z "${REGISTRY}" ]]; then + echo "REGISTRY must be set" > /dev/stderr + exit 1 +fi + +export TAG="$(date +%s)" + +function build() { + cmd=$(basename $1) + docker build --platform=linux/amd64 --quiet -t "$REGISTRY/$cmd:$TAG" -f "$f/Dockerfile" . + [[ -z "${SKIP_PUSH}" ]] && docker push "$REGISTRY/$cmd:$TAG" +} + +# Build! +for f in docker/*; do + build $f & +done +wait + +echo "Success! built and pushed tag: $TAG"