1
0
intel-media-ffmpeg/templates/sles/25-create-user.in
2020-07-24 19:46:57 -07:00

31 lines
677 B
Plaintext

# Create user 'user' and add them to 'sudo' access and set
# the passwd to 'user'.
FROM xe-base-stage AS xe-user-stage
USER root
RUN zypper install -y sudo
# NOTE: Requires 'sudo' package to already be installed.
ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=1000
RUN echo "Creating 'user': $USER_UID:$USER_GID"
RUN groupadd -r ${USERNAME} \
&& useradd --no-log-init \
-s /bin/bash \
-m \
-u ${USER_UID} \
-g ${USERNAME} \
-G users,video \
-p $(echo "${USERNAME}" | openssl passwd -stdin) ${USERNAME}
# Change ALL ALL=(ALL) ALL to use '%users...NOPASSWD:ALL'
RUN sed -i -e 's,^ALL.*,%users ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user