aboutsummaryrefslogtreecommitdiff
path: root/.docker/dockerfile-common.sh
diff options
context:
space:
mode:
Diffstat (limited to '.docker/dockerfile-common.sh')
-rw-r--r--.docker/dockerfile-common.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/.docker/dockerfile-common.sh b/.docker/dockerfile-common.sh
new file mode 100644
index 000000000..c9c1a4efa
--- /dev/null
+++ b/.docker/dockerfile-common.sh
@@ -0,0 +1,34 @@
+export DOCKER_BUILDKIT=1
+
+export BUILDKIT_ARCH=$(uname -m)
+export ARCH=${BUILDKIT_ARCH}
+
+if [ "$BUILDKIT_ARCH" == "amd64" ]; then
+ export BUILDKIT_ARCH="amd64"
+ export ARCH=x64
+fi
+
+if [ "$BUILDKIT_ARCH" == "x86_64" ]; then
+ export BUILDKIT_ARCH="amd64"
+ export ARCH=x64
+fi
+
+if [ "$BUILDKIT_ARCH" == "arm64" ]; then
+ export BUILDKIT_ARCH="arm64"
+ export ARCH=aarch64
+fi
+
+if [ "$BUILDKIT_ARCH" == "aarch64" ]; then
+ export BUILDKIT_ARCH="arm64"
+ export ARCH=aarch64
+fi
+
+if [ "$BUILDKIT_ARCH" == "armv7l" ]; then
+ echo "Unsupported platform: $BUILDKIT_ARCH"
+ exit 1
+fi
+
+export BUILD_ID=$(cat build-id)
+export CONTAINER_NAME=bun-linux-$ARCH
+export DEBUG_CONTAINER_NAME=debug-bun-linux-$ARCH
+export TEMP=/tmp/bun-0.0.$BUILD_ID