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