Make root default user in CI image (#1034)

For #884
This commit is contained in:
Sergey Kuznetsov
2023-12-12 14:05:30 +00:00
committed by GitHub
parent 3c4a8f0cfb
commit db751e3807

View File

@@ -3,6 +3,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH ARG TARGETARCH
USER root USER root
WORKDIR /root/
ENV GCC_VERSION=11 \ ENV GCC_VERSION=11 \
CCACHE_VERSION=4.8.3 \ CCACHE_VERSION=4.8.3 \
@@ -51,16 +52,11 @@ RUN wget https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VER
# Clean up # Clean up
RUN rm -rf /tmp/* /var/tmp/* RUN rm -rf /tmp/* /var/tmp/*
# Add clio user WORKDIR /root/
RUN useradd -ms /bin/bash clio \ # Using root by default is not very secure but github checkout action doesn't work with any other user
&& echo 'clio ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # https://github.com/actions/checkout/issues/956
# And Github Actions doc recommends using root
USER clio # https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
WORKDIR /home/clio
# Setup environment
ENV CCACHE_DIR=/home/clio/.ccache \
CONAN_USER_HOME=/home/clio/
# Setup conan # Setup conan
RUN conan profile new default --detect \ RUN conan profile new default --detect \