add image for local-path-provisioner

This commit is contained in:
Benjamin Elder
2022-05-12 13:05:06 -07:00
parent 87e3c7a70f
commit 83206a8877
4 changed files with 57 additions and 1 deletions

View File

@@ -16,8 +16,9 @@ export DOCKER_CLI_EXPERIMENTAL=enabled
PLATFORMS?=linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
OUTPUT?=
PROGRESS=auto
EXTRA_BUILD_OPT?=
build: ensure-buildx
docker buildx build --platform=${PLATFORMS} $(OUTPUT) --progress=$(PROGRESS) -t ${IMAGE} --pull .
docker buildx build --platform=${PLATFORMS} $(OUTPUT) --progress=$(PROGRESS) -t ${IMAGE} --pull $(EXTRA_BUILD_OPT) .
# push the cross built image
push: OUTPUT=--push

View File

@@ -0,0 +1,25 @@
# Copyright 2022 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.18
RUN git clone https://github.com/rancher/local-path-provisioner
ARG VERSION
RUN cd local-path-provisioner && \
git fetch && git checkout "${VERSION}" && \
scripts/build && \
mv bin/local-path-provisioner /usr/local/bin/local-path-provisioner
FROM gcr.io/distroless/base-debian11
COPY --from=0 /usr/local/bin/local-path-provisioner /usr/local/bin/local-path-provisioner
ENTRYPOINT /usr/local/bin/local-path-provisioner

View File

@@ -0,0 +1,17 @@
# Copyright 2022 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
VERSION=v0.0.22
TAG=$(VERSION)-kind.0
EXTRA_BUILD_OPT=--build-arg=VERSION=$(VERSION)
include $(CURDIR)/../Makefile.common.in

View File

@@ -0,0 +1,13 @@
# local-path-provisioner
This image packages https://github.com/rancher/local-path-provisioner to meet
our requirements.
- Not based on alpine (see: https://github.com/kubernetes/kubernetes/issues/109406#issuecomment-1103479928)
- Control over building with current patched go version
## Building
You can `make quick` in this directory to build a test image.
To push an actual image use `make push`.