-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
33 lines (24 loc) · 971 Bytes
/
Containerfile
File metadata and controls
33 lines (24 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM golang:1.25.5 AS builder
WORKDIR /build
ENV GOCACHE=/go-cache GOMODCACHE=/gomod-cache
ARG VERSION
ARG COMMIT
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/gomod-cache go mod download
COPY main.go ./
COPY internal/ ./internal/
RUN --mount=type=cache,target=/go-cache \
--mount=type=cache,target=/gomod-cache \
go test ./...
RUN --mount=type=cache,target=/go-cache \
--mount=type=cache,target=/gomod-cache \
echo "Building - Version: ${VERSION}, Commit: ${COMMIT}" && go build -ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT}" .
FROM quay.io/buildah/stable:v1.42
LABEL org.opencontainers.image.source = "https://github.com/404systems/plugin-buildah"
ENV BUILDAH_LAYERS=true BUILDAH_ISOLATION="rootless" HOME="/tmp" \
REGISTRIES_FILE="/tmp/registries.conf" AUTHS_FILE="/tmp/auths.json"
WORKDIR /workspace
VOLUME [ "/workspace" ]
USER 1000:1000
COPY --from=builder /build/plugin-buildah /
ENTRYPOINT [ "/plugin-buildah" ]