Open ghost opened 1 year ago
You can get it to build at least with the following changes. No clue if it actually works properly.
diff --git a/Dockerfile b/Dockerfile
index 42ff620..d60be0b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,17 +1,17 @@
FROM node:16-alpine3.15 AS frontend-builder
COPY frontend/ /app
-RUN cd /app && npm install && npm run build
+RUN apk add python3 make g++ && cd /app && npm install && npm run build
FROM golang:1.17.3-buster AS backend-builder
RUN go install github.com/gobuffalo/packr/v2/packr2@latest
COPY --from=frontend-builder /app/static /app/frontend/static
COPY . /app
-RUN cd /app && packr2 && env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-linkmode external -extldflags -static -s -w' -o ovpn-admin && packr2 clean
+RUN cd /app && packr2 && env CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -a -tags netgo -ldflags '-linkmode external -extldflags -static -s -w' -o ovpn-admin && packr2 clean
FROM alpine:3.16
WORKDIR /app
COPY --from=backend-builder /app/ovpn-admin /app
RUN apk add --update bash easy-rsa openssl openvpn coreutils && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
- wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.4/openvpn-user-linux-amd64.tar.gz -O - | tar xz -C /usr/local/bin && \
+ wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.4/openvpn-user-linux-arm64.tar.gz -O - | tar xz -C /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
=> ERROR [frontend-builder 3/3] RUN cd /app && npm install && npm run build 46.2s