Add /etc/passwd and /etc/group to k3s docker image

Fixes `cannot find name for user ID 0: No such file or directory` errors when checking user info in docker image

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7474a6fa43)
pull/9938/head
Brad Davidson 8 months ago committed by Brad Davidson
parent 6d2e9314b1
commit 06ec6e51af

@ -3,6 +3,8 @@ RUN apk add -U ca-certificates tar zstd tzdata
COPY build/out/data.tar.zst /
RUN mkdir -p /image/etc/ssl/certs /image/run /image/var/run /image/tmp /image/lib/modules /image/lib/firmware && \
tar -xa -C /image -f /data.tar.zst && \
echo "root:x:0:0:root:/:/bin/sh" > /image/etc/passwd && \
echo "root:x:0:" > /image/etc/group && \
cp /etc/ssl/certs/ca-certificates.crt /image/etc/ssl/certs/ca-certificates.crt
FROM scratch as collect

Loading…
Cancel
Save