| 1 |
# Copyright 2023 The Kubernetes Authors. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
# NOTE: this is just a default placeholder for convenience |
| 16 |
# To build this image properly, please invoke test/e2e/testing-manifests/auth/encrypt/run-e2e.sh |
| 17 |
ARG BUILDER_IMAGE=golang:latest |
| 18 |
FROM $BUILDER_IMAGE AS builder |
| 19 |
|
| 20 |
WORKDIR /workspace |
| 21 |
|
| 22 |
# Copy the source |
| 23 |
COPY apimachinery/ apimachinery/ |
| 24 |
COPY kms/ kms/ |
| 25 |
WORKDIR /workspace/kms/internal/plugins/_mock |
| 26 |
|
| 27 |
ARG TARGETARCH |
| 28 |
ARG TARGETPLATFORM |
| 29 |
ARG GOTOOLCHAIN |
| 30 |
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o mock-kms-plugin plugin.go |
| 31 |
|
| 32 |
FROM alpine:latest |
| 33 |
|
| 34 |
RUN apk add --update --no-cache ca-certificates gcompat |
| 35 |
RUN apk add --no-cache softhsm |
| 36 |
|
| 37 |
COPY --from=builder /workspace/kms/internal/plugins/_mock/mock-kms-plugin /usr/local/bin/mock-kms-plugin |
| 38 |
|
| 39 |
ENTRYPOINT [ "mock-kms-plugin" ] |