-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
59 lines (48 loc) · 1.69 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
# This Dockerfile contains multiple targets.
# Use 'docker build --target=<name> .' to build one.
ARG GO_VERSION=latest
# devbuild compiles the binary
# -----------------------------------
FROM docker.mirror.hashicorp.services/golang:${GO_VERSION} AS devbuild
ENV CGO_ENABLED=0
# Leave the GOPATH
WORKDIR /build
COPY . ./
RUN go build -o vault-csi-provider
# dev runs the binary from devbuild
# -----------------------------------
FROM docker.mirror.hashicorp.services/alpine:3.20.3 AS dev
COPY --from=devbuild /build/vault-csi-provider /bin/
ENTRYPOINT [ "/bin/vault-csi-provider" ]
# Default release image.
# -----------------------------------
FROM docker.mirror.hashicorp.services/alpine:3.20.3 AS default
ARG PRODUCT_VERSION
ARG PRODUCT_REVISION
ARG PRODUCT_NAME=vault-csi-provider
ARG TARGETOS
ARG TARGETARCH
LABEL name="Vault CSI Provider" \
maintainer="Vault Team <[email protected]>" \
vendor="HashiCorp" \
version=$PRODUCT_VERSION \
release=$PRODUCT_VERSION \
revision=$PRODUCT_REVISION \
org.opencontainers.image.licenses="BUSL-1.1" \
summary="HashiCorp Vault Provider for Secret Store CSI Driver for Kubernetes" \
description="Provides a CSI provider for Kubernetes to interact with HashiCorp Vault."
RUN set -eux && \
apk update && \
apk upgrade --no-cache libcrypto3
# Copy license to conform to HC IPS-002
COPY LICENSE /usr/share/doc/$PRODUCT_NAME/LICENSE.txt
COPY dist/$TARGETOS/$TARGETARCH/vault-csi-provider /bin/
ENTRYPOINT [ "/bin/vault-csi-provider" ]
# ===================================
#
# Set default target to 'dev'.
#
# ===================================
FROM dev