From d84eab6ee331994ed361aa6ccbfd3ff3fbaa8878 Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 9 Dec 2024 18:18:12 -0800 Subject: [PATCH] wip2 --- Dockerfile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7bea4a4..002a43d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,22 +30,34 @@ RUN if [ -f /custom/custom_opa.tar.gz ]; then \ RUN if [ -f /factdb/factdb.tar.gz ]; then \ cd /factdb && \ tar xzf factdb.tar.gz && \ - CGO_ENABLED=0 go build -ldflags="-s -w -extldflags=-static" -o /factdb ./cmd/factstore_server && \ + go build -ldflags="-extldflags=-static" -o /bin/factdb ./cmd/factstore_server && \ rm -rf /factdb ; \ else \ case $(uname -m) in \ x86_64) \ if [ -f /factdb/factstore_server-linux-amd64 ]; then \ - cp /factdb/factstore_server-linux-amd64 /factdb; \ + cp /factdb/factstore_server-linux-amd64 /bin/factdb; \ else \ - touch /factdb ; \ + echo "factstore_server-linux-amd64 not found." ; \ + if [ "$ALLOW_MISSING_FACTSTORE" = "false" ]; then \ + echo "Missing Factstore is not allowed, exiting..."; exit 1; \ + else \ + echo "Missing Factstore is allowed, continuing..."; \ + touch /bin/factdb ; \ + fi \ fi \ ;; \ aarch64) \ if [ -f /factdb/factstore_server-linux-arm64 ]; then \ - cp /factdb/factstore_server-linux-arm64 /factdb; \ + cp /factdb/factstore_server-linux-arm64 /bin/factdb; \ else \ - touch /factdb ; \ + echo "factstore_server-linux-arm64 not found." ; \ + if [ "$ALLOW_MISSING_FACTSTORE" = "false" ]; then \ + echo "Missing Factstore is not allowed, exiting..."; exit 1; \ + else \ + echo "Missing Factstore is allowed, continuing..."; \ + touch /bin/factdb ; \ + fi \ fi \ ;; \ *) \ @@ -54,6 +66,7 @@ RUN if [ -f /factdb/factdb.tar.gz ]; then \ esac ; \ fi + # MAIN IMAGE ---------------------------------------- FROM python:3.10-alpine3.18