File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ permissions:
1919
2020jobs :
2121 build-and-push-image :
22+ strategy :
23+ matrix :
24+ variety :
25+ - archlinux
26+ - busybox
27+ - debian
28+ - ubuntu
2229 name : docker buildx pkgxdev/pkgx:${{ github.event.release.tag_name || github.event.inputs.tag }}
2330 runs-on : ubuntu-latest
2431 steps :
3138 - name : is_latest?
3239 id : latest
3340 run : |
41+ if [ ${{ matrix.variety }} != ubuntu ]; then
42+ echo "value=false" >> "${GITHUB_OUTPUT}"
43+ return
44+ fi
3445 TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.tag }}"
3546 LATEST_RELEASE=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name')
3647 if [ "$TAG_NAME" == "$LATEST_RELEASE" ]; then
91102 --push \
92103 $tags \
93104 --platform linux/amd64,linux/arm64 \
94- --file ./src/.github/Dockerfile \
105+ --file ./src/.github/Dockerfile.${{ matrix.variety }} \
95106 .
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: ci·docker
33on :
44 pull_request :
55 paths :
6- - .github /Dockerfile
6+ - docker /Dockerfile.*
77 - .github/workflows/ci.docker.yml
88
99concurrency :
@@ -15,7 +15,7 @@ permissions:
1515 packages : write
1616
1717jobs :
18- docker- build :
18+ build-pkgx :
1919 runs-on : ubuntu-latest
2020 container : debian:buster-slim
2121 steps :
3131 name : products
3232 path : ./target/release/pkgx
3333
34- docker-test :
34+ build-docker :
3535 runs-on : ubuntu-latest
36- needs : docker-build
36+ needs : build-pkgx
37+ strategy :
38+ matrix :
39+ variety :
40+ - archlinux
41+ - busybox
42+ - debian
43+ - ubuntu
3744 steps :
3845 - uses : actions/checkout@v4
3946
@@ -48,13 +55,13 @@ jobs:
4855
4956 - run :
5057 docker build
51- --tag pkgxdev/pkgx
52- --file .github/Dockerfile
58+ --tag pkgxdev/${{ matrix.variety }}
59+ --file .github/Dockerfile.${{ matrix.variety }}
5360 .
5461
5562 - run : |
5663 cat <<EoD> Dockerfile
57- FROM pkgxdev/pkgx
64+ FROM pkgxdev/${{ matrix.variety }}
5865 RUN pkgx --version
5966 RUN if git --version; then exit 1; fi
6067 RUN pkgx git --version
Original file line number Diff line number Diff line change 1+ FROM archlinux AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM archlinux AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgx
8+ COPY --from=stage0 /usr/local/bin/pkgm /usr/local/bin/pkgm
9+
10+ SHELL ["/bin/bash", "-c"]
11+ CMD ["/bin/bash", "-i"]
12+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM debian:buster-slim AS stage1
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM busybox:glibc AS stage2
7+ COPY --from=stage1 /usr/local/bin/pkgx /usr/local/bin/pkgx
8+ COPY --from=stage1 /usr/local/bin/pkgm /usr/local/bin/pkgm
9+
10+ # pkgx packages also need libgcc
11+ COPY --from=stage1 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1
12+ # these are part of glibc but for some reason this image doesn’t have them
13+ COPY --from=stage1 /lib/x86_64-linux-gnu/librt-2.28.so /lib/librt.so.1
14+ COPY --from=stage1 /lib/x86_64-linux-gnu/libdl-2.28.so /lib/libdl.so.2
15+ # we need env for `pkgm`
16+ COPY --from=stage1 /usr/bin/env /usr/bin/env
17+
18+ SHELL ["/bin/sh", "-c"]
19+ CMD ["/bin/sh", "-i"]
20+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM debian AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM debian AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgx
8+ COPY --from=stage0 /usr/local/bin/pkgm /usr/local/bin/pkgm
9+
10+ SHELL ["/bin/bash", "-c"]
11+ CMD ["/bin/bash", "-i"]
12+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM ubuntu AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM ubuntu AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgx
8+ COPY --from=stage0 /usr/local/bin/pkgm /usr/local/bin/pkgm
9+
10+ SHELL ["/bin/bash", "-c"]
11+ CMD ["/bin/bash", "-i"]
12+ ENTRYPOINT ["/usr/local/bin/pkgx"]
You can’t perform that action at this time.
0 commit comments