-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build+ci: add Dockerfile and workflow
Refs: #5303 Change-Id: I757249bfc247a581c8dc9c782fef767561fd6896
- Loading branch information
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Waf build system | ||
build/ | ||
.waf-*-*/ | ||
.waf3-*-*/ | ||
.lock-waf* | ||
|
||
# Compiled python code | ||
**/__pycache__/ | ||
**/*.py[cod] | ||
|
||
# Qt Creator | ||
*.creator | ||
*.creator.user | ||
.qtc_clangd/ | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
|
||
# macOS | ||
**/.DS_Store | ||
**/.AppleDouble | ||
**/.LSOverride | ||
**/._* | ||
|
||
# Other | ||
Dockerfile | ||
VERSION.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Docker | ||
on: | ||
push: | ||
tags: | ||
- 'ndn-tools-*' | ||
schedule: | ||
# twice a month | ||
- cron: '20 10 5,20 * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
ndn-tools: | ||
uses: named-data/actions/.github/workflows/docker-image.yml@v1 | ||
with: | ||
name: ndn-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG NDN_CXX_VERSION=latest | ||
FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build | ||
|
||
RUN apt-get install -Uy --no-install-recommends \ | ||
libpcap-dev \ | ||
&& apt-get distclean | ||
|
||
ARG JOBS | ||
ARG SOURCE_DATE_EPOCH | ||
RUN --mount=rw,target=/src <<EOF | ||
set -eux | ||
cd /src | ||
./waf configure \ | ||
--prefix=/usr \ | ||
--libdir=/usr/lib \ | ||
--sysconfdir=/etc \ | ||
--localstatedir=/var \ | ||
--sharedstatedir=/var | ||
./waf build | ||
./waf install | ||
mkdir -p /deps/debian | ||
touch /deps/debian/control | ||
cd /deps | ||
for binary in ndnpeek ndnpoke ndncatchunks ndnputchunks ndnping ndnpingserver ndndump ndn-dissect; do | ||
dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \ | ||
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}" | ||
done | ||
EOF | ||
|
||
|
||
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndn-tools | ||
|
||
COPY --link --from=build /usr/bin/ndnpeek /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndnpoke /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndncatchunks /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndnping /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndnpingserver /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndndump /usr/bin/ | ||
COPY --link --from=build /usr/bin/ndn-dissect /usr/bin/ | ||
|
||
RUN --mount=from=build,source=/deps,target=/deps \ | ||
apt-get install -Uy --no-install-recommends $(cat /deps/ndn*) \ | ||
&& apt-get distclean | ||
|
||
ENV HOME=/config | ||
VOLUME /config | ||
VOLUME /run/nfd |