Skip to content

Commit 0bd5e23

Browse files
committed
fix: sonarqube - This image runs with root or containerAdministrator as the default user. Make sure it is safe here.
1 parent e03a515 commit 0bd5e23

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

playwright/docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ RUN apt-get update && \
2121
apt-get clean && \
2222
rm -rf /var/lib/apt/lists/*
2323

24+
# Create a non-root user for the build
25+
RUN groupadd -r builder && useradd -r -g builder builder
26+
27+
# Create directories with proper permissions
28+
RUN mkdir -p /opt/jellyfin /jellyfin && \
29+
chown -R builder:builder /opt /jellyfin
30+
31+
# Switch to non-root user for the build steps
32+
USER builder
33+
2434
# Clone and build Jellyfin backend
2535
WORKDIR /opt
2636
RUN git clone https://github.com/jellyfin/jellyfin.git --depth 1

0 commit comments

Comments
 (0)