Images: Rework. (1/3) (#13014)

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
k8s-infra-cherrypick-robot 2025-03-23 09:26:32 -07:00 committed by GitHub
parent f051ca3b3f
commit c34e26ed1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 119 additions and 260 deletions

View file

@ -15,8 +15,8 @@ ARG BASE_IMAGE
ARG GOLANG_VERSION
ARG ETCD_VERSION
FROM golang:${GOLANG_VERSION}-alpine3.21 as GO
FROM registry.k8s.io/etcd:${ETCD_VERSION} as etcd
FROM golang:${GOLANG_VERSION}-alpine3.21 AS go
FROM registry.k8s.io/etcd:${ETCD_VERSION} AS etcd
FROM ${BASE_IMAGE}
@ -41,9 +41,9 @@ RUN set -eux; \
echo 'hosts: files dns' > /etc/nsswitch.conf; \
fi
COPY --from=GO /usr/local/go /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
COPY --from=go /usr/local/go /usr/local/go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
COPY --from=etcd /usr/local/bin/etcd /usr/local/bin/etcd