Skip to content

Commit

Permalink
docker: switch to ubuntu:24.04 as base image
Browse files Browse the repository at this point in the history
Change-Id: I6b7b8b4875e6f850e8ff2e26ca1cc106d5df455a
  • Loading branch information
Pesa committed May 3, 2024
1 parent d6a8644 commit 5eb7a07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# syntax=docker/dockerfile:1

FROM ubuntu:23.10 AS build
ARG SOURCE_DATE_EPOCH
FROM ubuntu:24.04 AS build

RUN apt-get install -Uy --no-install-recommends \
dpkg-dev \
Expand All @@ -18,11 +17,11 @@ RUN apt-get install -Uy --no-install-recommends \
libssl-dev \
pkgconf \
python3 \
# use 'apt-get distclean' when we upgrade to ubuntu:24.04
&& rm -rf /var/lib/apt/lists/*
&& apt-get distclean

ARG JOBS
RUN --mount=type=bind,rw,target=/src <<EOF
ARG SOURCE_DATE_EPOCH
RUN --mount=rw,target=/src <<EOF
set -eux
cd /src
./waf configure \
Expand All @@ -35,21 +34,20 @@ cd /src
--enable-shared
./waf build
./waf install

mkdir -p /deps/debian
touch /deps/debian/control
cd /deps
dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx
EOF

FROM ubuntu:23.10 AS runtime
ARG SOURCE_DATE_EPOCH

RUN --mount=type=bind,from=build,source=/deps,target=/deps \
FROM ubuntu:24.04 AS runtime

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

RUN --mount=type=bind,from=build,source=/usr,target=/build \
RUN --mount=from=build,source=/usr,target=/build \
cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
&& cp -av /build/bin/ndnsec* /usr/bin/
8 changes: 5 additions & 3 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,12 @@ def version(ctx):
cmd = ['git', 'describe', '--abbrev=8', '--always', '--match', f'{GIT_TAG_PREFIX}*']
version_from_git = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
if version_from_git:
if version_from_git.startswith(GIT_TAG_PREFIX):
Context.g_module.VERSION = version_from_git.lstrip(GIT_TAG_PREFIX)
if GIT_TAG_PREFIX and version_from_git.startswith(GIT_TAG_PREFIX):
Context.g_module.VERSION = version_from_git[len(GIT_TAG_PREFIX):]
elif not GIT_TAG_PREFIX and ('.' in version_from_git or '-' in version_from_git):
Context.g_module.VERSION = version_from_git
else:
# no tags matched
# no tags matched (or we are in a shallow clone)
Context.g_module.VERSION = f'{VERSION_BASE}+git.{version_from_git}'
except (OSError, subprocess.SubprocessError):
pass
Expand Down

0 comments on commit 5eb7a07

Please sign in to comment.