Skip to content

Commit

Permalink
feat[ASM-11561]- CI and Security: add caching on build
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-akeyless committed Jun 30, 2024
1 parent 1c03e39 commit 4f3aa25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ WORKDIR /src

COPY . .

RUN --mount=type=cache,mode=0755,target=/go/pkg/mod go mod download

ARG ARC="amd64"
ARG LDFLAGS=""
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$ARC go build -ldflags "${LDFLAGS}" -a -installsuffix cgo -o akeyless-csi-provider .
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod --mount=type=cache,target="/root/.cache/go-build" CGO_ENABLED=0 GOOS=linux GOARCH=$ARC go build -ldflags "${LDFLAGS}" -a -installsuffix cgo -o akeyless-csi-provider .

# Final stage
FROM alpine:3.20.1
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GO_VERSION = $(shell go mod edit -json | jq -r .Go)
DATE = $(shell date -u +%Y%m%d.%H%M%S)
IMAGE_NAME = "docker.io/akeyless/akeyless-csi-provider"
IMAGE_NAME = docker.io/akeyless/akeyless-csi-provider
VERSION ?= 0.0.0

ifeq ($(VERSION), 0.0.0)
TAG = "latest"
TAG = latest
else
TAG = v$(VERSION)
endif
Expand Down

0 comments on commit 4f3aa25

Please sign in to comment.