create nsswitch-conf if missing (#9339)
This commit is contained in:
parent
04ce92338e
commit
9d562c47ab
1 changed files with 7 additions and 1 deletions
|
@ -21,7 +21,13 @@ FROM registry.k8s.io/etcd:${ETCD_VERSION} as etcd
|
|||
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
RUN set -eux; \
|
||||
if [ -e /etc/nsswitch.conf ]; then \
|
||||
grep '^hosts: files dns' /etc/nsswitch.conf; \
|
||||
else \
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf; \
|
||||
fi
|
||||
|
||||
|
||||
COPY --from=GO /usr/local/go /usr/local/go
|
||||
COPY --from=etcd /usr/local/bin/etcd /usr/local/bin/etcd
|
||||
|
|
Loading…
Reference in a new issue