]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Fix compat with latest patchwork/pyenv image
authorStephen Finucane <stephen@that.guru>
Sat, 6 Jun 2026 12:04:43 +0000 (13:04 +0100)
committerStephen Finucane <stephen@that.guru>
Sat, 6 Jun 2026 14:45:25 +0000 (15:45 +0100)
We switched to the Ubuntu 24.04 base image some time back. This includes
an ubuntu user that conflicts with the patchwork user we were creating.
Simplify this by using the ubuntu user instead.

Signed-off-by: Stephen Finucane <stephen@that.guru>
.github/workflows/ci.yaml
docker-compose-pg.yml
docker-compose-sqlite3.yml
docker-compose.yml
tools/docker/Dockerfile
tools/docker/entrypoint.sh

index 4af0f7091759cef88fc9a5223d6d1a3b72e611d5..9d750d13d55ea9d91fd618e99c0e654a26a419de 100644 (file)
@@ -73,6 +73,8 @@ jobs:
           --health-interval 10s
           --health-timeout 5s
           --health-retries 5
+          --gtid-mode=OFF
+          --enforce-gtid-consistency=OFF
     steps:
       - name: Checkout source code
         uses: actions/checkout@v6
@@ -149,7 +151,7 @@ jobs:
           cache: 'pip'
       - name: Build docker-compose service
         run: |
-          docker compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g)
+          docker compose build
       - name: Test createsuperuser/changepassword
         run: |
           docker compose run -T --rm web \
index a88daf071dd760fd46b2eb336c719a445a843395..e625a364345fcc02338baa3083beb0ffcd2f5d38 100644 (file)
@@ -13,18 +13,13 @@ services:
     build:
       context: .
       dockerfile: ./tools/docker/Dockerfile
-      args:
-        - UID
-        - GID
     depends_on:
       - db
     volumes:
-      - .:/home/patchwork/patchwork/
+      - .:/home/ubuntu/patchwork/
     ports:
       - "8000:8000"
     environment:
-      - UID
-      - GID
       - DATABASE_TYPE=postgres
       - DATABASE_HOST=db
       - DATABASE_PORT=5432
index 900cb71fdca422ab61cd4f483c8ed9fa77c4ee83..0603b187725375e3d543e5549c6c5b837de4d1e6 100644 (file)
@@ -4,16 +4,11 @@ services:
     build:
       context: .
       dockerfile: ./tools/docker/Dockerfile
-      args:
-        - UID
-        - GID
     command: python3 manage.py runserver 0.0.0.0:8000
     volumes:
-      - .:/home/patchwork/patchwork/
+      - .:/home/ubuntu/patchwork/
     ports:
       - "8000:8000"
     environment:
-      - UID
-      - GID
       - DATABASE_TYPE=sqlite3
-      - DATABASE_NAME=/home/patchwork/patchwork/tools/docker/db/db.sqlite3
+      - DATABASE_NAME=/home/ubuntu/patchwork/tools/docker/db/db.sqlite3
index 878d3185bb89b9859a2d28cef4659376500e3d04..78d80f5617b19a77673b0a7811dd6c3501088904 100644 (file)
@@ -2,6 +2,7 @@
 services:
   db:
     image: mysql:9.7
+    command: --gtid-mode=OFF --enforce-gtid-consistency=OFF
     volumes:
       - ./tools/docker/db/data:/var/lib/mysql
     environment:
@@ -18,18 +19,13 @@ services:
     build:
       context: .
       dockerfile: ./tools/docker/Dockerfile
-      args:
-        - UID
-        - GID
     depends_on:
       - db
     volumes:
-      - .:/home/patchwork/patchwork/
+      - .:/home/ubuntu/patchwork/
     ports:
       - "8000:8000"
     environment:
-      - UID
-      - GID
       # skip DATABASE_TYPE explicitly as mysql should be the default type.
       - DATABASE_HOST=db
       - DATABASE_PORT=3306
index 6d942492ee64e498db8071f89058b107cd22450f..550171c70d4a26afe76bc733b6cb21365aa354e9 100644 (file)
@@ -1,16 +1,11 @@
 FROM ghcr.io/getpatchwork/pyenv:latest
 
-ARG UID=1000
-ARG GID=1000
-
 ARG TZ="Australia/Canberra"
 ENV DEBIAN_FRONTEND noninteractive
 ENV PYTHONUNBUFFERED 1
-ENV PROJECT_HOME /home/patchwork/patchwork
+ENV PROJECT_HOME /home/ubuntu/patchwork
 ENV DJANGO_SETTINGS_MODULE patchwork.settings.dev
 
-RUN groupadd -o --gid=$GID patchwork && \
-    useradd --uid=$UID --gid=$GID --create-home patchwork
 RUN rm -f /etc/localtime; ln -s /usr/share/zoneinfo/$TZ /etc/localtime
 
 RUN eval "$(pyenv init -)"
@@ -37,5 +32,5 @@ RUN pip install -r /opt/requirements-dev.txt
 COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
 CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
-USER patchwork
-WORKDIR /home/patchwork/patchwork
+USER ubuntu
+WORKDIR /home/ubuntu/patchwork
index c78c0581f1b52f8f892e0ddbbdda97716965bcbb..f141b723531dd14654786ef7ee62d389fe230ce5 100755 (executable)
@@ -40,13 +40,13 @@ test_database() {
 
 # check if patchwork is mounted. Checking if we exist is a
 # very good start!
-if [ ! -f ~patchwork/patchwork/tools/docker/entrypoint.sh ]; then
+if [ ! -f ~/patchwork/tools/docker/entrypoint.sh ]; then
     cat << EOF
 The patchwork directory doesn't seem to be mounted!
 
 Are you using docker-compose? If so, you may need to create an SELinux rule.
 Refer to the development installation documentation for more information.
-If not, you need -v PATH_TO_PATCHWORK:/home/patchwork/patchwork
+If not, you need -v PATH_TO_PATCHWORK:/home/ubuntu/patchwork
 EOF
     exit 1
 fi