Skip to content

Commit

Permalink
Merge the Dockerfiles, add nfd-autoreg target
Browse files Browse the repository at this point in the history
Refs: #5303
Change-Id: I1f1babbb38cfc702218f844d30b81914ca5c274f
  • Loading branch information
Pesa committed Apr 12, 2024
1 parent e76d7b5 commit 01d0aa6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
target: nfd
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

nfd-status-http-server:
needs: nfd
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Login to ${{ env.REGISTRY }}
uses: docker/login-action@v3
Expand All @@ -76,8 +77,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./tools
file: ./tools/Dockerfile.nfd-status-http-server
context: .
target: nfd-status-http-server
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
40 changes: 35 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,49 @@ for binary in nfd nfdc nfd-autoreg; do
done
EOF

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

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

COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/

RUN --mount=type=bind,from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
apt-get install -Uy --no-install-recommends $(cat /deps/nfd-autoreg) \
&& rm -rf /var/lib/apt/lists/*

COPY --link --from=build /usr/bin/nfd /usr/bin/
VOLUME /run/nfd

ENTRYPOINT ["/usr/bin/nfd-autoreg"]


FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server

COPY --link --from=build /usr/bin/nfdc /usr/bin/
COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/
COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/

RUN --mount=type=bind,from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends $(cat /deps/nfdc) \
python3 \
&& rm -rf /var/lib/apt/lists/*

VOLUME /run/nfd

EXPOSE 8080/tcp

ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"]


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

COPY --link --from=build /usr/bin/nfdc /usr/bin/
COPY --link --from=build /usr/bin/nfd /usr/bin/
COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf

ENV HOME=/config
RUN --mount=type=bind,from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
&& rm -rf /var/lib/apt/lists/*

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

Expand Down
22 changes: 0 additions & 22 deletions tools/Dockerfile.nfd-status-http-server

This file was deleted.

0 comments on commit 01d0aa6

Please sign in to comment.