From 35740ea166560e6927dd05a3b4cbe896c09e1d15 Mon Sep 17 00:00:00 2001 From: Tomasz Jonak Date: Tue, 31 Oct 2023 17:39:36 +0100 Subject: [PATCH] [arm64] arch aware docker build --- Dockerfile | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8cfd4b..5019961 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ +ARG DF_IMG_TAG=latest +ARG IMAGE_REPOSITORY=deepfenceio +FROM $IMAGE_REPOSITORY/deepfence_vectorscan_build:$DF_IMG_TAG AS vectorscan + FROM golang:1.20-alpine3.18 AS builder MAINTAINER DeepFence RUN apk update \ - && apk add --upgrade gcc musl-dev pkgconfig g++ make git \ - && apk add hyperscan-dev --repository=https://dl-cdn.alpinelinux.org/alpine/v3.13/community -ENV PKG_CONFIG_PATH=/usr/local/include/hs/ \ - CGO_CFLAGS="-I/usr/local/include/hyperscan/src" \ - LD_LIBRARY_PATH=/usr/local/lib:/usr/local/include/hs/lib:$LD_LIBRARY_PATH + && apk add --upgrade gcc musl-dev pkgconfig g++ make git + +COPY --from=vectorscan /vectorscan.tar.bz2 / +RUN tar -xjf /vectorscan.tar.bz2 -C / && rm /vectorscan.tar.bz2 WORKDIR /home/deepfence/src/SecretScanner COPY . . @@ -19,13 +22,24 @@ LABEL deepfence.role=system ENV MGMT_CONSOLE_URL=deepfence-internal-router \ MGMT_CONSOLE_PORT=443 -RUN apk update && apk add --no-cache --upgrade curl tar libstdc++ libgcc docker skopeo bash podman \ - && apk add hyperscan --repository=https://dl-cdn.alpinelinux.org/alpine/v3.13/community \ - && nerdctl_version=1.4.0 \ - && curl -fsSLOk https://github.com/containerd/nerdctl/releases/download/v${nerdctl_version}/nerdctl-${nerdctl_version}-linux-amd64.tar.gz \ - && tar Cxzvvf /usr/local/bin nerdctl-${nerdctl_version}-linux-amd64.tar.gz \ - && rm nerdctl-${nerdctl_version}-linux-amd64.tar.gz \ - && apk del curl + +ARG TARGETARCH + +RUN apk add --no-cache --upgrade tar libstdc++ libgcc docker skopeo bash podman + +RUN <