Browse Source

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>
pull/9838/head
Brad Davidson 8 months ago committed by Brad Davidson
parent
commit
7474a6fa43
  1. 2
      package/Dockerfile

2
package/Dockerfile

@ -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