Skip to content

Commit

Permalink
docker: split CA and client into two separate targets
Browse files Browse the repository at this point in the history
Change-Id: I62ad850f0415e2e161e00fb75ff2d25536888458
  • Loading branch information
Pesa committed May 7, 2024
1 parent 794dcbd commit 6d00e0b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ permissions:
id-token: write

jobs:
ndncert:
ndncert-build:
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: ndncert
name: ndncert-build
target: build
ndncert-ca:
needs: ndncert-build
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: ndncert-ca
target: ca
contexts: build=docker-image://${{ needs.ndncert-build.outputs.image }}
ndncert-client:
needs: ndncert-build
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: ndncert-client
target: client
contexts: build=docker-image://${{ needs.ndncert-build.outputs.image }}
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ RUN --mount=rw,target=/src <<EOF
EOF


FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndncert
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ca

COPY --link --from=build /usr/lib/libndn-cert.so.* /usr/lib/
COPY --link --from=build /usr/bin/ndncert-ca-server /usr/bin/
COPY --link --from=build /usr/bin/ndncert-ca-status /usr/bin/
COPY --link --from=build /usr/bin/ndncert-send-email-challenge /usr/bin/
COPY --link --from=build /usr/bin/ndncert-client /usr/bin/

RUN apt-get install -Uy --no-install-recommends \
python3 \
Expand All @@ -37,4 +36,18 @@ VOLUME /etc/ndncert
VOLUME /run/nfd

ENTRYPOINT ["/usr/bin/ndncert-ca-server"]
CMD ["-c", "/config/ca.conf"]
CMD ["-c", "/config/ndncert-ca.conf"]


FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS client

COPY --link --from=build /usr/lib/libndn-cert.so.* /usr/lib/
COPY --link --from=build /usr/bin/ndncert-client /usr/bin/
COPY --link --from=build /etc/ndncert/client.conf.sample /config/ndncert-client.conf

ENV HOME=/config
VOLUME /config
VOLUME /run/nfd

ENTRYPOINT ["/usr/bin/ndncert-client"]
CMD ["-c", "/config/ndncert-client.conf"]

0 comments on commit 6d00e0b

Please sign in to comment.