Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit b9ce8b3

Browse files
feat: sonarqube dockerfile tag and user added
1 parent ade6dcb commit b9ce8b3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

database/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
FROM mcr.microsoft.com/mssql-tools:latest
22

3-
3+
# Use root initially to set permissions
4+
USER root
45
WORKDIR /database
56
COPY db-setup-entrypoint.sh /database/
67
COPY create_database_statement.sql /database/
78
RUN chmod +x /database/db-setup-entrypoint.sh
89

10+
# Create a non-root user if needed (mssql-tools doesn't come with a default non-root user)
11+
RUN useradd -m -s /bin/bash mssqltools && \
12+
chown -R mssqltools:mssqltools /database
913

10-
ENTRYPOINT ["/database/db-setup-entrypoint.sh"]
14+
# Switch to non-root user for security
15+
USER mssqltools
1116

17+
ENTRYPOINT ["/database/db-setup-entrypoint.sh"]

0 commit comments

Comments
 (0)