21 lines
503 B
Plaintext
21 lines
503 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 dnf install -y sudo
|
|
|
|
# NOTE: Requires 'sudo' package to already be installed
|
|
RUN groupadd -r user \
|
|
&& useradd --no-log-init \
|
|
-s /bin/bash \
|
|
-r -m \
|
|
-g user \
|
|
-G sudo \
|
|
-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
|
|
|
|
USER user
|