Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5: remove the dependency on busybox #15037

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions Dockerfile-release.amd64
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
FROM --platform=linux/amd64 busybox:1.34.1 as source
FROM --platform=linux/amd64 gcr.io/distroless/base-debian11

COPY --from=source /bin/sh /bin/sh
COPY --from=source /bin/mkdir /bin/mkdir
FROM --platform=linux/amd64 gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
RUN mkdir -p /var/etcd/
RUN mkdir -p /var/lib/etcd/

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

# Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf,
# but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving
# (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918)
# To fix this we just create /etc/nsswitch.conf and add the following line:
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
ADD nsswitch.conf /etc/nsswitch.conf

EXPOSE 2379 2380

Expand Down
12 changes: 4 additions & 8 deletions Dockerfile-release.arm64
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM --platform=linux/arm64 busybox:1.34.1 as source
FROM --platform=linux/arm64 gcr.io/distroless/base-debian11

COPY --from=source /bin/sh /bin/sh
COPY --from=source /bin/mkdir /bin/mkdir
FROM --platform=linux/arm64 gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd
ENV ETCD_UNSUPPORTED_ARCH=arm64

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
11 changes: 4 additions & 7 deletions Dockerfile-release.ppc64le
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM --platform=linux/ppc64le busybox:1.34.1 as source
FROM --platform=linux/ppc64le gcr.io/distroless/base-debian11

COPY --from=source /bin/sh /bin/sh
COPY --from=source /bin/mkdir /bin/mkdir
FROM --platform=linux/ppc64le gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
12 changes: 4 additions & 8 deletions Dockerfile-release.s390x
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM --platform=linux/s390x busybox:1.34.1 as source
FROM --platform=linux/s390x gcr.io/distroless/base-debian11

COPY --from=source /bin/sh /bin/sh
COPY --from=source /bin/mkdir /bin/mkdir

FROM --platform=linux/s390x gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
2 changes: 2 additions & 0 deletions nsswitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

2 changes: 2 additions & 0 deletions scripts/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ mkdir -p "${IMAGEDIR}"/var/etcd
mkdir -p "${IMAGEDIR}"/var/lib/etcd
cp "${BINARYDIR}"/etcd "${BINARYDIR}"/etcdctl "${BINARYDIR}"/etcdutl "${IMAGEDIR}"

cp ./nsswitch.conf "${IMAGEDIR}"

cat ./"${DOCKERFILE}" > "${IMAGEDIR}"/Dockerfile

if [ -z "$TAG" ]; then
Expand Down