1
0
intel-media-ffmpeg/templates/ubuntu/18-create-user.in
James Ketrenos b26d1e5df5 Update to latest xe-solutions
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
2021-01-19 12:03:40 -08:00

31 lines
782 B
Plaintext

# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM xe-base-stage AS xe-user-stage
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get install --no-install-recommends -y \
sudo
ARG USER_UID=1000
ARG USER_GID=1000
RUN echo "Creating 'user': $USER_UID:$USER_GID"
# NOTE: Requires 'sudo' package to already be installed
RUN groupadd -g $USER_GID user \
&& useradd --no-log-init \
-s /bin/bash \
-m \
-u $USER_UID \
-g user \
-G sudo,video \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}