-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·32 lines (23 loc) · 907 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use the almalinux:9 image as the base
FROM almalinux:9
# Install necessary packages
RUN dnf update -y \
&& dnf install -y python3-pip python3-devel alsa-lib-devel \
&& dnf groupinstall -y 'Development Tools' \
&& dnf install -y Xvfb xorg-x11-server-Xvfb
# Create a new user named 'appuser'
RUN groupadd -g 1002 appuser \
&& useradd -ms /bin/bash -u 1001 -g 1002 appuser
# Copy the testscript.sh file into the appuser's home directory
COPY testscript.sh /home/appuser/testscript.sh
COPY testscript_docker.sh /home/appuser/testscript_docker.sh
# Change the ownership of the testscript.sh file to the new user
RUN chown appuser:appuser /home/appuser/testscript.sh
# Switch to the new user
USER appuser
# Set the working directory to the new user's home directory
WORKDIR /home/appuser
# Install coverage
RUN pip install coverage
# Run the script as the new user
CMD sh -c ./testscript_docker.sh