Skip to content

Commit

Permalink
build+ci: add Dockerfile and workflow
Browse files Browse the repository at this point in the history
Refs: #5303
Change-Id: I5706b946598468b430216a3bf2ec9e8601de3c96
  • Loading branch information
pulsejet authored and Pesa committed May 6, 2024
1 parent 49326eb commit 794dcbd
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .dockerignore
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
19 changes: 19 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Docker
on:
push:
tags:
- 'v?[0-9]+.[0-9]+*'
schedule:
# twice a month
- cron: '20 11 5,20 * *'
workflow_dispatch:

permissions:
packages: write
id-token: write

jobs:
ndncert:
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: ndncert
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# syntax=docker/dockerfile:1

ARG NDN_CXX_VERSION=latest
FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build

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
EOF


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

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 \
&& apt-get distclean

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

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

0 comments on commit 794dcbd

Please sign in to comment.