mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-29 22:42:10 +01:00
sdk_lib/Dockerfile.sdk-import: use root user by default
sdk_entry.sh is expected to be called by the root user, so we set USER root:root. Also we add a "root" entry to passwd and group since it does not exist in the SDK tarball. Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This commit is contained in:
parent
1928852af0
commit
e6a4349355
@ -6,6 +6,10 @@ RUN touch /etc/debian_chroot
|
|||||||
RUN chmod 644 /etc/passwd
|
RUN chmod 644 /etc/passwd
|
||||||
RUN chmod 644 /etc/group
|
RUN chmod 644 /etc/group
|
||||||
|
|
||||||
|
# User "root" is not in /etc/passwd / group in the SDK tarball
|
||||||
|
RUN echo 'root:x:0:0:root:/root:/bin/bash' >>/etc/passwd
|
||||||
|
RUN echo 'root:x:0:' >>/etc/group
|
||||||
|
|
||||||
RUN if ! grep -q portage /etc/group ; then \
|
RUN if ! grep -q portage /etc/group ; then \
|
||||||
echo "portage::250:portage" >>/etc/group; \
|
echo "portage::250:portage" >>/etc/group; \
|
||||||
fi
|
fi
|
||||||
@ -46,6 +50,7 @@ RUN echo "if [ -f /mnt/host/source/.sdkenv ]; then source /mnt/host/source/.sdke
|
|||||||
COPY --chown=sdk:sdk sdk_lib/sdk_entry.sh /home/sdk
|
COPY --chown=sdk:sdk sdk_lib/sdk_entry.sh /home/sdk
|
||||||
RUN chmod 755 /home/sdk/sdk_entry.sh
|
RUN chmod 755 /home/sdk/sdk_entry.sh
|
||||||
|
|
||||||
|
USER root:root
|
||||||
# This should be a NOP; if you see packages being rebuilt
|
# This should be a NOP; if you see packages being rebuilt
|
||||||
# it's likely that submodules and SDK tarball are out of sync
|
# it's likely that submodules and SDK tarball are out of sync
|
||||||
RUN /home/sdk/sdk_entry.sh ./update_chroot --toolchain_boards="amd64-usr arm64-usr"
|
RUN /home/sdk/sdk_entry.sh ./update_chroot --toolchain_boards="amd64-usr arm64-usr"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user