-
Notifications
You must be signed in to change notification settings - Fork 37
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: I73e4b44676a3433e653c38e075a2cd2266bf51d5
- Loading branch information
Showing
3 changed files
with
112 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: | ||
- 'NLSR-*' | ||
schedule: | ||
# twice a month | ||
- cron: '20 9 5,20 * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
nlsr: | ||
uses: named-data/actions/.github/workflows/docker-image.yml@v1 | ||
with: | ||
name: nlsr |
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,66 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG NDN_CXX_VERSION=latest | ||
|
||
FROM scratch AS psync | ||
ARG PSYNC_VERSION=master | ||
ADD https://github.com/named-data/PSync.git#${PSYNC_VERSION} / | ||
|
||
FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build | ||
|
||
RUN apt-get install -Uy --no-install-recommends \ | ||
libboost-iostreams-dev \ | ||
&& apt-get distclean | ||
|
||
ARG JOBS | ||
ARG SOURCE_DATE_EPOCH | ||
RUN --mount=from=psync,rw,target=/psync <<EOF | ||
set -eux | ||
cd /psync | ||
./waf configure \ | ||
--prefix=/usr \ | ||
--libdir=/usr/lib \ | ||
--sysconfdir=/etc \ | ||
--localstatedir=/var \ | ||
--sharedstatedir=/var | ||
./waf build | ||
./waf install | ||
EOF | ||
RUN --mount=rw,target=/src <<EOF | ||
set -eux | ||
cd /src | ||
./waf configure \ | ||
--prefix=/usr \ | ||
--libdir=/usr/lib \ | ||
--sysconfdir=/etc \ | ||
--localstatedir=/var \ | ||
--sharedstatedir=/var \ | ||
--with-psync | ||
./waf build | ||
./waf install | ||
mkdir -p /deps/debian | ||
touch /deps/debian/control | ||
cd /deps | ||
dpkg-shlibdeps --ignore-missing-info /usr/lib/libPSync.so.* /usr/bin/nlsr /usr/bin/nlsrc -O \ | ||
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > nlsr | ||
EOF | ||
|
||
|
||
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nlsr | ||
|
||
COPY --link --from=build /usr/lib/libPSync.so.* /usr/lib/ | ||
COPY --link --from=build /usr/bin/nlsr /usr/bin/ | ||
COPY --link --from=build /usr/bin/nlsrc /usr/bin/ | ||
COPY --link --from=build /etc/ndn/nlsr.conf.sample /config/nlsr.conf | ||
|
||
RUN --mount=from=build,source=/deps,target=/deps \ | ||
apt-get install -Uy --no-install-recommends $(cat /deps/nlsr) \ | ||
&& apt-get distclean | ||
|
||
ENV HOME=/config | ||
VOLUME /config | ||
VOLUME /var/lib/nlsr | ||
VOLUME /run/nfd | ||
|
||
ENTRYPOINT ["/usr/bin/nlsr"] | ||
CMD ["-f", "/config/nlsr.conf"] |