Skip to content

Commit 9c64acd

Browse files
authored
Merge pull request libgit2#5980 from libgit2/ethomson/dockerfile
docker: remove the entrypoint
2 parents 962d78d + b140e22 commit 9c64acd

File tree

6 files changed

+30
-33
lines changed

6 files changed

+30
-33
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
docker-registry: docker.pkg.github.com
14-
docker-config-path: ci/docker
14+
docker-config-path: source/ci/docker
1515

1616
jobs:
1717
# Build the docker container images that we will use for our Linux
@@ -55,7 +55,7 @@ jobs:
5555
if: matrix.container.qemu == true
5656
- name: Download existing container
5757
run: |
58-
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
58+
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
5959
env:
6060
DOCKER_REGISTRY: ${{ env.docker-registry }}
6161
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -206,17 +206,18 @@ jobs:
206206
- name: Check out repository
207207
uses: actions/checkout@v2
208208
with:
209+
path: source
209210
fetch-depth: 0
210211
- name: Set up build environment
211-
run: ci/setup-${{ matrix.platform.setup-script }}.sh
212+
run: source/ci/setup-${{ matrix.platform.setup-script }}.sh
212213
shell: bash
213214
if: matrix.platform.setup-script != ''
214215
- name: Setup QEMU
215216
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
216217
if: matrix.platform.container.qemu == true
217218
- name: Download container
218219
run: |
219-
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
220+
"${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
220221
env:
221222
DOCKER_REGISTRY: ${{ env.docker-registry }}
222223
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -233,8 +234,9 @@ jobs:
233234
if [ -n "${{ matrix.platform.container.name }}" ]; then
234235
docker run \
235236
--rm \
236-
-v "$(pwd):/home/libgit2/source" \
237-
-w /home/libgit2/source \
237+
--user libgit2:libgit2 \
238+
-v "$(pwd)/source:/home/libgit2/source" \
239+
-w /home/libgit2 \
238240
-e ASAN_SYMBOLIZER_PATH \
239241
-e CC \
240242
-e CFLAGS \
@@ -247,11 +249,11 @@ jobs:
247249
-e TSAN_OPTIONS \
248250
-e UBSAN_OPTIONS \
249251
${{ env.docker-registry-container-sha }} \
250-
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
252+
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
251253
else
252254
mkdir build && cd build
253-
../ci/build.sh
254-
../ci/test.sh
255+
../source/ci/build.sh
256+
../source/ci/test.sh
255257
fi
256258
shell: bash
257259

.github/workflows/nightly.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ jobs:
215215
- name: Check out repository
216216
uses: actions/checkout@v2
217217
with:
218+
path: source
218219
fetch-depth: 0
219220
- name: Set up build environment
220221
run: ci/setup-${{ matrix.platform.setup-script }}.sh
@@ -242,8 +243,9 @@ jobs:
242243
if [ -n "${{ matrix.platform.container.name }}" ]; then
243244
docker run \
244245
--rm \
245-
-v "$(pwd):/home/libgit2/source" \
246-
-w /home/libgit2/source \
246+
--user libgit2:libgit2 \
247+
-v "$(pwd)/source:/home/libgit2/source" \
248+
-w /home/libgit2 \
247249
-e ASAN_SYMBOLIZER_PATH \
248250
-e CC \
249251
-e CFLAGS \
@@ -255,11 +257,11 @@ jobs:
255257
-e SKIP_SSH_TESTS \
256258
-e TSAN_OPTIONS \
257259
${{ env.docker-registry-container-sha }} \
258-
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
260+
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
259261
else
260262
mkdir build && cd build
261-
../ci/build.sh
262-
../ci/test.sh
263+
../source/ci/build.sh
264+
../source/ci/test.sh
263265
fi
264266
shell: bash
265267

ci/docker/bionic

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ RUN cd /tmp && \
3636
cd .. && \
3737
rm -rf mbedtls-2.16.2
3838

39-
FROM mbedtls AS configure
40-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
41-
RUN chmod a+x /usr/local/bin/entrypoint.sh
42-
RUN mkdir /var/run/sshd
39+
FROM mbedtls AS adduser
40+
RUN useradd --shell /bin/bash libgit2 --create-home
4341

44-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
42+
FROM adduser AS configure
43+
RUN mkdir /var/run/sshd

ci/docker/entrypoint.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci/docker/focal

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ RUN cd /tmp && \
7272
cd .. && \
7373
rm -rf valgrind-3.15.0
7474

75-
FROM valgrind AS configure
76-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
77-
RUN chmod a+x /usr/local/bin/entrypoint.sh
78-
RUN mkdir /var/run/sshd
75+
FROM valgrind AS adduser
76+
RUN useradd --shell /bin/bash libgit2 --create-home
7977

80-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
78+
FROM adduser AS configure
79+
RUN mkdir /var/run/sshd

ci/docker/xenial

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ RUN cd /tmp && \
5959
cd .. && \
6060
rm -rf valgrind-3.15.0
6161

62-
FROM valgrind AS configure
63-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
64-
RUN chmod a+x /usr/local/bin/entrypoint.sh
65-
RUN mkdir /var/run/sshd
62+
FROM valgrind AS adduser
63+
RUN useradd --shell /bin/bash libgit2 --create-home
6664

67-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
65+
FROM adduser AS configure
66+
RUN mkdir /var/run/sshd

0 commit comments

Comments
 (0)