1
0
intel-media-ffmpeg/templates/sles/25-create-user.in
James P. Ketrenos e1331590a5 Updated to latest xe-solutions
Added SLES support

Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
2020-09-25 14:51:09 -07:00

36 lines
877 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
# Disable env clearing so USER env is available in SUDO
# Needed for env values set which are needed by the base OS, eg zypper
# and *_proxy *_PROXY...
RUN echo "Defaults !env_reset" >> /etc/sudoers
USER user