Skip to content

Commit 55881c8

Browse files
committed
Create the user before installing the tools as that user
Also actually cleanup the cache, there is another better method for that but I'll leave that for another PR.
1 parent 9c84b13 commit 55881c8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docker-gitlabci/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ FROM ubuntu:24.04
22
ENV DEBIAN_FRONTEND=noninteractive
33
ENV PHPSUPPORTED="7.4 8.0 8.1 8.2"
44
ENV APTINSTALL="apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold"
5+
RUN useradd -m domjudge
6+
RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-0
7+
RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-1
8+
RUN groupadd domjudge-run
9+
510
RUN apt-get update && apt-get install -y \
611
acl make zip unzip apache2-utils bsdmainutils libcurl4-gnutls-dev \
712
libjsoncpp-dev libmagic-dev autoconf automake bats sudo debootstrap procps \
@@ -25,9 +30,10 @@ RUN apt-get update && apt-get install -y \
2530
&& rm -rf /var/lib/apt/lists/*
2631

2732
# Install needed NPM packages and download chrome for the domjudge user
28-
RUN su domjudge -c "npm install pa11y puppeteer && \
33+
RUN su domjudge -c "cd /home/domjudge && \
34+
npm install pa11y puppeteer && \
2935
npx puppeteer browsers install chrome && \
30-
npm cache clean"
36+
npm cache clean --force"
3137

3238
# Install needed global PHP modules
3339
RUN composer -n require justinrainbow/json-schema
@@ -46,11 +52,6 @@ RUN add-apt-repository ppa:ondrej/php -y && apt-get update && \
4652
# Put the gitlab user in sudo
4753
RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
4854

49-
RUN useradd -m domjudge
50-
RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-0
51-
RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-1
52-
RUN groupadd domjudge-run
53-
5455
# Update dictionary to latest version
5556
ENV GITHUBDICTIONARY="https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt"
5657
ENV CODESPELLDICTLOCATION="/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt"

0 commit comments

Comments
 (0)