From 7b657a119e46454780a11c45ced6cf5eb40053f3 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Tue, 5 Jul 2022 13:49:07 -0700 Subject: [PATCH] updated dockerfile to support multi-arch builds --- net/container/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/container/Dockerfile b/net/container/Dockerfile index 6620436a..10eba418 100644 --- a/net/container/Dockerfile +++ b/net/container/Dockerfile @@ -1,4 +1,5 @@ FROM ubuntu:20.04 +ARG TARGETPLATFORM LABEL maintainer="roland.osborne@gmail.com" EXPOSE 7000 @@ -30,9 +31,14 @@ RUN npm install -g n RUN n stable RUN mkdir /app -RUN wget -P /app https://go.dev/dl/go1.17.5.linux-amd64.tar.gz -RUN tar -C /usr/local -xzf /app/go1.17.5.linux-amd64.tar.gz + +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=aarch64; else ARCHITECTURE=unsupported; fi \ + && wget -P /app https://go.dev/dl/go1.17.5.linux-${ARCHITECTURE}.tar.gz \ + && tar -C /usr/local -xzf /app/go1.17.5.linux-${ARCHITECTURE}.tar.gz + RUN git clone https://github.com/balzack/databag.git /app/databag + +RUN yarn config set network-timeout 300000 RUN yarn --cwd /app/databag/net/web install RUN yarn --cwd /app/databag/net/web build RUN cd /app/databag/net/server; /usr/local/go/bin/go build databag