Skip to content

Commit 5d5799f

Browse files
authored
add non-privileged default user for docker archives (#1556)
* add default user for archive images. * not a tty
1 parent 1b39823 commit 5d5799f

15 files changed

+35
-9
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ jobs:
5151
run: |
5252
# tests failed before 1.6.0 (and repository structure was different)
5353
if [[ "${{ inputs.version }}" == "dev" || $(echo -e "${{ inputs.version }}\n1.6.0" | sort -V | head -n1) == "1.6.0" ]]; then
54-
container=$(docker create -q -i -t -w /app -v "$(pwd):/app" "${{ env.docker_repository }}:test_${{ inputs.version }}")
55-
trap 'docker rm -f "${container}" >/dev/null' 0 1 2 3 15
56-
docker start "${container}" >/dev/null
57-
docker exec "${container}" setup_user.sh "$(id -u)" "$(id -g)"
58-
docker exec -u "$(id -u):$(id -g)" -w /home/gpsbabel/gpsbabel-build -e PNAME=/usr/local/bin/gpsbabel "${container}" ./testo
54+
docker run --rm -w /home/gpsbabel/gpsbabel-build -e PNAME=/usr/local/bin/gpsbabel "${{ env.docker_repository }}:test_${{ inputs.version }}" ./testo
5955
fi
6056
- name: Docker Metadata
6157
id: meta

tools/archive_images/Dockerfile_gpsbabel_1.10.0

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7676
&& ln -s $(pwd)/gui/GPSBabelFE/gpsbabelfe /usr/local/bin
7777

7878
COPY setup_user.sh /usr/local/bin
79+
USER ubuntu:ubuntu
80+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.5.0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7272
&& ln -s $(pwd)/gui/GPSBabel1.5.0/gpsbabelfe /usr/local/bin
7373

7474
COPY setup_user.sh /usr/local/bin
75+
RUN useradd ubuntu -m -s /bin/bash
76+
USER ubuntu:ubuntu
77+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.5.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7272
&& ln -s $(pwd)/gui/GPSBabel1.5.1/gpsbabelfe /usr/local/bin
7373

7474
COPY setup_user.sh /usr/local/bin
75+
RUN useradd ubuntu -m -s /bin/bash
76+
USER ubuntu:ubuntu
77+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.5.2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7474
#ENTRYPOINT ["/usr/local/bin/gpsbabel"]
7575

7676
COPY setup_user.sh /usr/local/bin
77+
RUN useradd ubuntu -m -s /bin/bash
78+
USER ubuntu:ubuntu
79+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.5.3

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7171
&& ln -s $(pwd)/gui/GPSBabel1.5.3/gpsbabelfe /usr/local/bin
7272

7373
COPY setup_user.sh /usr/local/bin
74+
RUN useradd ubuntu -m -s /bin/bash
75+
USER ubuntu:ubuntu
76+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.5.4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7171
&& ln -s $(pwd)/gui/GPSBabel1.5.4/gpsbabelfe /usr/local/bin
7272

7373
COPY setup_user.sh /usr/local/bin
74+
RUN useradd ubuntu -m -s /bin/bash
75+
USER ubuntu:ubuntu
76+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.6.0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7272
&& ln -s $(pwd)/gui/GPSBabelFE/gpsbabelfe /usr/local/bin
7373

7474
COPY setup_user.sh /usr/local/bin
75+
RUN useradd ubuntu -m -s /bin/bash
76+
USER ubuntu:ubuntu
77+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.7.0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7272
&& ln -s $(pwd)/gui/GPSBabelFE/gpsbabelfe /usr/local/bin
7373

7474
COPY setup_user.sh /usr/local/bin
75+
RUN useradd ubuntu -m -s /bin/bash
76+
USER ubuntu:ubuntu
77+
WORKDIR /app

tools/archive_images/Dockerfile_gpsbabel_1.8.0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ RUN git clone https://github.com/GPSBabel/gpsbabel.git gpsbabel-build\
7070
&& ln -s $(pwd)/gui/GPSBabelFE/gpsbabelfe /usr/local/bin
7171

7272
COPY setup_user.sh /usr/local/bin
73+
RUN useradd ubuntu -m -s /bin/bash
74+
USER ubuntu:ubuntu
75+
WORKDIR /app

0 commit comments

Comments
 (0)