Skip to content

Commit

Permalink
Add jenkins user to docker images
Browse files Browse the repository at this point in the history
Jenkins calls docker like with a user mapping to the runner's user id:

    docker run -t -d -u 1001:1001 -w ...

If the user doesn't exist in the image, the fs permissions are messed
up, which caused issues after trying to upgrade the GraalVM polyglot
package in CrateDB. See crate/crate#15769

Adding a jenkins user to the images should fix this.
  • Loading branch information
mfussenegger committed Apr 9, 2024
1 parent 7f79c38 commit ccd94f4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM rust:1.72

RUN \
groupadd jenkins && \
useradd -u 1001 -g jenkins -m jenkins && \
apt-get update && \
apt-get -y upgrade && \
apt-get -y --no-install-recommends install openjdk-17-jdk python3-venv python3-dev

ENV HOME /root
WORKDIR /root
USER root
USER jenkins

CMD ["bash"]
4 changes: 3 additions & 1 deletion tests/client_tests/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM golang:1.21

RUN \
groupadd jenkins && \
useradd -u 1001 -g jenkins -m jenkins && \
apt-get update && \
apt-get -y upgrade && \
apt-get -y install python3-venv python3-dev

ENV HOME /root
WORKDIR /root
USER root
USER jenkins

CMD ["bash"]
4 changes: 3 additions & 1 deletion tests/client_tests/haskell/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM haskell:9

RUN \
groupadd jenkins && \
useradd -u 1001 -g jenkins -m jenkins && \
apt-get update && \
apt-get -y install \
libpq-dev \
Expand All @@ -10,6 +12,6 @@ RUN \

ENV HOME /root
WORKDIR /root
USER root
USER jenkins

CMD ["/bin/bash"]
4 changes: 3 additions & 1 deletion tests/client_tests/node-postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM node:15-buster

RUN \
groupadd jenkins && \
useradd -u 1001 -g jenkins -m jenkins && \
apt-get update && \
apt-get -y install python3-pip libpq5 libpq-dev sudo

ENV HOME /root
WORKDIR /root
USER ROOT
USER jenkins

CMD ["bash"]
4 changes: 3 additions & 1 deletion tests/client_tests/stock_npgsql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0

RUN \
groupadd jenkins && \
useradd -u 1001 -g jenkins -m jenkins && \
apt-get update && \
apt-get -y install python3-venv python3-dev build-essential

ENV HOME /root
WORKDIR /root
USER root
USER jenkins

CMD ["bash"]

0 comments on commit ccd94f4

Please sign in to comment.