Skip to content

Commit 3e7309e

Browse files
committed
Make the nonroot user explicitly
1 parent d116eef commit 3e7309e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM php:8.2-apache
2-
USER 1000
2+
RUN useradd nonroot
33
LABEL maintainer="Mark Tompsett <[email protected]>"
44

55
ENV REFRESHED_AT 2023-07-12
@@ -23,10 +23,9 @@ RUN apt-get update -y \
2323

2424
RUN mkdir -p /data
2525
WORKDIR /data
26-
COPY --chown=1000:www-data ./ /data
26+
COPY --chown=nonroot:www-data ./ /data
2727

2828
RUN cd /data && ./composer-install.sh
2929
RUN mv /data/composer.phar /usr/bin/composer
3030
RUN /usr/bin/composer install
31-
# User 1000 is the first user on a *nix system
32-
USER 1000
31+
USER nonroot

0 commit comments

Comments
 (0)