Skip to content

Commit

Permalink
Allow configuration a base image in Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Enrique Lacal <[email protected]>
  • Loading branch information
EnriqueL8 committed May 16, 2024
1 parent 65de030 commit 7bd525c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG BASE_IMAGE

FROM golang:1.21-alpine3.19 AS fabconnect-builder
RUN apk add make
ADD . /fabconnect
Expand All @@ -15,7 +17,7 @@ RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/
RUN trivy fs --format spdx-json --output /sbom.spdx.json /SBOM
RUN trivy sbom /sbom.spdx.json --severity UNKNOWN,HIGH,CRITICAL --exit-code 1 --ignorefile /SBOM/.trivyignore

FROM alpine:3.19
FROM $BASE_IMAGE
RUN apk add curl
WORKDIR /fabconnect
COPY --from=fabconnect-builder /fabconnect/fabconnect ./
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ firefly-fabconnect: ${GOFILES}
$(VGO) build -o ${BINARY_NAME} -ldflags "-X main.buildDate=`date -u +\"%Y-%m-%dT%H:%M:%SZ\"` -X main.buildVersion=$(BUILD_VERSION)" -tags=prod -tags=prod -v
go-mod-tidy: .ALWAYS
go mod tidy
docker:
docker build --build-arg BASE_IMAGE=alpine:3.19 -t hyperledger/firefly-fabconnect .
build: firefly-fabconnect-nocgo firefly-fabconnect
.ALWAYS: ;
clean:
Expand Down

0 comments on commit 7bd525c

Please sign in to comment.