From e852f25ac414138263978c1b162d8862661bff55 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:41:20 +0100 Subject: [PATCH 01/23] Initial packaging attempt. --- .github/pkg.yml | 28 +++++++++++ pkg/debian/postinst | 8 +++ pkg/debian/postrm | 7 +++ pkg/rpm/scriptlets.toml | 17 +++++++ pkg/rules/docker-images-to-build.yml | 36 +++++++++++++ pkg/rules/packages-to-build.yml | 75 ++++++++++++++++++++++++++++ pkg/test-scripts/test-dnst.sh | 17 +++++++ 7 files changed, 188 insertions(+) create mode 100644 .github/pkg.yml create mode 100644 pkg/debian/postinst create mode 100644 pkg/debian/postrm create mode 100644 pkg/rpm/scriptlets.toml create mode 100644 pkg/rules/docker-images-to-build.yml create mode 100644 pkg/rules/packages-to-build.yml create mode 100644 pkg/test-scripts/test-dnst.sh diff --git a/.github/pkg.yml b/.github/pkg.yml new file mode 100644 index 0000000..b47a5a9 --- /dev/null +++ b/.github/pkg.yml @@ -0,0 +1,28 @@ +name: Packaging + +on: + push: + tags: + - v* + + # Triggering on PRs and arbitrary branch pushes is not enabled because most of the time only the CI build should be + # triggered, not the packaging build. In cases where you want to test changes to this workflow this trigger enables + # you to manually invoke this workflow on an arbitrary branch as needed. + workflow_dispatch: + +jobs: + package: + uses: NLnetLabs/ploutos/.github/workflows/pkg-rust.yml@v7 + # secrets: + # DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }} + # DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + with: + docker_org: nlnetlabs + docker_repo: routinator + docker_build_rules: pkg/rules/docker-images-to-build.yml + docker_sanity_check_command: --version + + package_build_rules: pkg/rules/packages-to-build.yml + package_test_scripts_path: pkg/test-scripts/test-.sh + + rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file diff --git a/pkg/debian/postinst b/pkg/debian/postinst new file mode 100644 index 0000000..b470b60 --- /dev/null +++ b/pkg/debian/postinst @@ -0,0 +1,8 @@ +#!/bin/sh -e + +case "$1" in +configure) + # Create symbolic links + ln -s /usr/bin/ldns-nsec3-hash /usr/bin/dnst + ;; +esac \ No newline at end of file diff --git a/pkg/debian/postrm b/pkg/debian/postrm new file mode 100644 index 0000000..745620f --- /dev/null +++ b/pkg/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +case "$1" in +purge) + # Remove symbolic links + ;; +esac \ No newline at end of file diff --git a/pkg/rpm/scriptlets.toml b/pkg/rpm/scriptlets.toml new file mode 100644 index 0000000..1ebad27 --- /dev/null +++ b/pkg/rpm/scriptlets.toml @@ -0,0 +1,17 @@ +post_install_script = ''' +#!/bin/bash -e + +if [ $1 -eq 1 ] ; then + # Initial installation + # Create symbolic links +fi +''' + +post_uninstall_script = ''' +#!/bin/bash -e +#RPM_SYSTEMD_MACROS# + +if [ $1 -ge 1 ] ; then + # Remove symbolic links +fi +''' \ No newline at end of file diff --git a/pkg/rules/docker-images-to-build.yml b/pkg/rules/docker-images-to-build.yml new file mode 100644 index 0000000..36db497 --- /dev/null +++ b/pkg/rules/docker-images-to-build.yml @@ -0,0 +1,36 @@ +--- +# matrix field notes: +# platform: used by Docker to use the right architecture base image. +# the set of supported values can be seen at: +# https://go.dev/doc/install/source#environment +# from: https://github.com/docker-library/official-images#architectures-other-than-amd64 +# from: https://docs.docker.com/desktop/multi-arch/ +# one must also take any "normalization" into account, e.g. arm64v8 -> arm64, see: +# https://github.com/containerd/containerd/blob/v1.4.3/platforms/database.go#L83 +# see also: +# https://stackoverflow.com/a/70889505 +# shortname: used by us to tag the architecture specific "manifest" image. +# crosstarget: (optional) used to download the correct cross-compiled binary that was produced earlier by the +# 'cross' job above. +# mode: (optional) set to 'copy' for cross-compiled targets. +# cargo_args: (optional) can be used when testing, e.g. set to '--no-default-features' to speed up the Krill +# build. +include: + - platform: 'linux/amd64' + shortname: 'amd64' + mode: 'build' + + - platform: 'linux/arm/v6' + shortname: 'armv6' + crosstarget: 'arm-unknown-linux-musleabihf' + mode: 'copy' + + - platform: 'linux/arm/v7' + shortname: 'armv7' + crosstarget: 'armv7-unknown-linux-musleabihf' + mode: 'copy' + + - platform: 'linux/arm64' + shortname: 'arm64' + crosstarget: 'aarch64-unknown-linux-musl' + mode: 'copy' \ No newline at end of file diff --git a/pkg/rules/packages-to-build.yml b/pkg/rules/packages-to-build.yml new file mode 100644 index 0000000..498e538 --- /dev/null +++ b/pkg/rules/packages-to-build.yml @@ -0,0 +1,75 @@ +# This matrix definition is used as both the package_build_rules and the package_test_rules Ploutos packaging +# workflow inputs. +--- +pkg: + - 'dnst' +image: + - "ubuntu:xenial" # ubuntu/16.04 + - "ubuntu:bionic" # ubuntu/18.04 + - "ubuntu:focal" # ubuntu/20.04 + - "ubuntu:jammy" # ubuntu/22.04 + - "debian:stretch" # debian/9 + - "debian:buster" # debian/10 + - "debian:bullseye" # debian/11 + - "debian:bookworm" # debian/12 + - 'centos:7' + - 'rockylinux:8' # compatible with EOL centos:8 + - 'rockylinux:9' +target: + - 'x86_64' +test-image: + # Set 'test-image' to the empty string for all matrix permutations so that the default ('image') will be used + # to launch an LXC container to test the created packages in. Why explicitly set what is already the default? + # If this isn't present, later entries in the include set below will overwrite earlier entries that differ + # only by their 'test-image' value. If however 'test-image' is present in the original matrix by defining it + # here, then 'included' entries will no longer overwrite each other because they alter a key that is present + # in the original matrix. This is just how GitHub Actions matrix include rules work. + - "" +include: + # package for the Raspberry Pi 4b as an ARMv7 cross compiled variant of the Debian Bullseye upon which + # Raspbian 11 is based. + - pkg: 'dnst' + image: 'debian:bullseye' + target: 'armv7-unknown-linux-musleabihf' + + # package for the Raspberry Pi 1b as an ARMv6 cross compiled variant of the Debian Buster upon which + # Raspbian 10 is based. + - pkg: 'dnst' + image: 'debian:buster' + target: 'arm-unknown-linux-musleabihf' + + # package for the ROCK64 as an AARCH64 cross compiled variant of Debian Buster upon which Armbian 21 is based. + - pkg: 'dnst' + image: 'debian:buster' + target: 'aarch64-unknown-linux-musl' + + # the include entries below will not cause additional packages to be built because they specify combinations + # of matrix keys and values as already exist elsewhere in the matrix, but they will cause an additional tests + # to be run in the package testing phase, which will install the package in an LXC container running the + # specified 'test-image' instead of the 'image' it was built in. + - pkg: 'dnst' + image: 'rockylinux:9' + target: 'x86_64' + test-image: 'almalinux:9' + + - pkg: 'dnst' + image: 'rockylinux:9' + target: 'x86_64' + test-image: 'centos:9-Stream' + +# 'mode' is not used by the package building workflow job, but is used by the package testing workflow job. +# Ploutos will not include this key when using this matrix definition to generate package building matrix +# permutations but will use it when generating package testing permutations. +test-mode: + - 'fresh-install' + #- 'upgrade-from-published' + +# Disable upgrade testing on Rocky Linux 9 and Debian Bookworm as we haven't published any packages for +# those O/S versions yet. +#test-exclude: +# - pkg: 'routinator' +# image: 'rockylinux:9' +# mode: 'upgrade-from-published' +# - pkg: 'routinator' +# image: 'debian:bookworm' +# mode: 'upgrade-from-published' \ No newline at end of file diff --git a/pkg/test-scripts/test-dnst.sh b/pkg/test-scripts/test-dnst.sh new file mode 100644 index 0000000..9645e03 --- /dev/null +++ b/pkg/test-scripts/test-dnst.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -eo pipefail +set -x + +case $1 in + post-install) + # Run some sanity checks + dnst --version + dnst nsec3-hash nlnetlabs.nl + ldns-nsec3-hash nlnetlabs.nl + ;; + + post-upgrade) + # Nothing to do. + ;; +esac \ No newline at end of file From 8e056dc4af7d82d47e3517837b4c6d167918c6c6 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:57:23 +0100 Subject: [PATCH 02/23] Update pkg.yml --- .github/workflows/pkg.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index c4b1489..b47a5a9 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -2,8 +2,6 @@ name: Packaging on: push: - branches: - - "main" tags: - v* @@ -14,10 +12,17 @@ on: jobs: package: - # - # Set @vN to the latest released version. - # For more information see: https://github.com/NLnetLabs/ploutos/blob/main/README.md - # uses: NLnetLabs/ploutos/.github/workflows/pkg-rust.yml@v7 + # secrets: + # DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }} + # DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + with: + docker_org: nlnetlabs + docker_repo: routinator + docker_build_rules: pkg/rules/docker-images-to-build.yml + docker_sanity_check_command: --version - # TODO + package_build_rules: pkg/rules/packages-to-build.yml + package_test_scripts_path: pkg/test-scripts/test-.sh + + rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file From afb9c6ced8a33c0759cc1be735d9df5483c18038 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:59:40 +0100 Subject: [PATCH 03/23] Remove file in wrong directory. --- .github/pkg.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/pkg.yml diff --git a/.github/pkg.yml b/.github/pkg.yml deleted file mode 100644 index b47a5a9..0000000 --- a/.github/pkg.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Packaging - -on: - push: - tags: - - v* - - # Triggering on PRs and arbitrary branch pushes is not enabled because most of the time only the CI build should be - # triggered, not the packaging build. In cases where you want to test changes to this workflow this trigger enables - # you to manually invoke this workflow on an arbitrary branch as needed. - workflow_dispatch: - -jobs: - package: - uses: NLnetLabs/ploutos/.github/workflows/pkg-rust.yml@v7 - # secrets: - # DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }} - # DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} - with: - docker_org: nlnetlabs - docker_repo: routinator - docker_build_rules: pkg/rules/docker-images-to-build.yml - docker_sanity_check_command: --version - - package_build_rules: pkg/rules/packages-to-build.yml - package_test_scripts_path: pkg/test-scripts/test-.sh - - rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file From 68dd2516ce5b31b3652060ec8e1795201d7efb5f Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:01:58 +0100 Subject: [PATCH 04/23] No dockerfile yet. --- .github/workflows/pkg.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index b47a5a9..9a865a9 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -17,10 +17,10 @@ jobs: # DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }} # DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} with: - docker_org: nlnetlabs - docker_repo: routinator - docker_build_rules: pkg/rules/docker-images-to-build.yml - docker_sanity_check_command: --version + # docker_org: nlnetlabs + # docker_repo: routinator + # docker_build_rules: pkg/rules/docker-images-to-build.yml + # docker_sanity_check_command: --version package_build_rules: pkg/rules/packages-to-build.yml package_test_scripts_path: pkg/test-scripts/test-.sh From d7e51b28410a47a0b7b6919f3593b418fee05b22 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:37:21 +0100 Subject: [PATCH 05/23] Add required metadata and a symbolic link via assets (if that works other scripts will be needed). --- .github/workflows/pkg.yml | 2 +- Cargo.toml | 39 ++++++++++++++++++++++++++++++++++++++- pkg/links/ldns-nsec3-hash | 1 + 3 files changed, 40 insertions(+), 2 deletions(-) create mode 120000 pkg/links/ldns-nsec3-hash diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index b47a5a9..4e69abf 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -25,4 +25,4 @@ jobs: package_build_rules: pkg/rules/packages-to-build.yml package_test_scripts_path: pkg/test-scripts/test-.sh - rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file + #rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 3d15724..a05e3c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,11 @@ name = "dnst" version = "0.1.0" edition = "2021" +authors = ["NLnet Labs "] +description = "Reimplementation of important ldns programs." +repository = "https://github.com/NLnetLabs/dnst" +license = "BSD-3-Clause" +readme = "README.md" default-run = "dnst" [[bin]] @@ -19,4 +24,36 @@ lexopt = "0.3.0" test_bin = "0.4.0" [features] -arbitrary = [ "dep:arbitrary", "domain/arbitrary" ] \ No newline at end of file +arbitrary = [ "dep:arbitrary", "domain/arbitrary" ] + +[package.metadata.deb] +license-file = ["LICENSE", "0"] +depends = "$auto" +section = "net" +priority = "optional" +assets = [ + ["target/release/dnst", "usr/bin/", "755"], + ["links/ldns-nsec3-hash", "usr/bin/", "755"], + ["README.md", "usr/share/doc/dnst/", "644"], + # TODO: Extend Ploutos to generate the man pages from sources. + #["doc/dnst.1", "usr/share/man/man1/dnst.1", "644"], +] +changelog = "target/debian/changelog" # this will be generated by the pkg workflow +copyright = "Copyright (c) 2024, NLnet Labs. All rights reserved." +preserve-symlinks = true + +[package.metadata.generate-rpm] +# "BSD" alone is the 3-clause license. Inheriting "license" from above causes rpmlint to +# complain with "invalid-license". +# See: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing +license = "BSD" +assets = [ + { source = "target/release/dnst", dest = "/usr/bin/dnst", mode = "755" }, + { source = "links/ldns-nsec3-hash", dest = "/usr/bin/ldns-nsec3-hash", mode = "744" }, + # TODO: Extend Ploutos to generate the man pages from sources. + #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, +] +# These get set using cargo-generate-rpm --set-metadata at package build time. +#post_install_script = ... +#pre_uninstall_script = ... +#post_uninstall_script = ... \ No newline at end of file diff --git a/pkg/links/ldns-nsec3-hash b/pkg/links/ldns-nsec3-hash new file mode 120000 index 0000000..3487f80 --- /dev/null +++ b/pkg/links/ldns-nsec3-hash @@ -0,0 +1 @@ +/usr/bin/dnst \ No newline at end of file From fcb522e2e8aa4f77470b58fd0b3964231d40f2de Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:40:30 +0100 Subject: [PATCH 06/23] Fix incorrect links paths. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a05e3c6..712076c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ section = "net" priority = "optional" assets = [ ["target/release/dnst", "usr/bin/", "755"], - ["links/ldns-nsec3-hash", "usr/bin/", "755"], + ["pkg/links/ldns-nsec3-hash", "usr/bin/", "755"], ["README.md", "usr/share/doc/dnst/", "644"], # TODO: Extend Ploutos to generate the man pages from sources. #["doc/dnst.1", "usr/share/man/man1/dnst.1", "644"], @@ -49,7 +49,7 @@ preserve-symlinks = true license = "BSD" assets = [ { source = "target/release/dnst", dest = "/usr/bin/dnst", mode = "755" }, - { source = "links/ldns-nsec3-hash", dest = "/usr/bin/ldns-nsec3-hash", mode = "744" }, + { source = "pkg/links/ldns-nsec3-hash", dest = "/usr/bin/ldns-nsec3-hash", mode = "744" }, # TODO: Extend Ploutos to generate the man pages from sources. #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, ] From 2e5c0c057cd576d1dfc207f082879781fef19689 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:49:57 +0100 Subject: [PATCH 07/23] Does 777 help for a symlink? --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 712076c..fbfc4c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ section = "net" priority = "optional" assets = [ ["target/release/dnst", "usr/bin/", "755"], - ["pkg/links/ldns-nsec3-hash", "usr/bin/", "755"], + ["pkg/links/ldns-nsec3-hash", "usr/bin/", "777"], ["README.md", "usr/share/doc/dnst/", "644"], # TODO: Extend Ploutos to generate the man pages from sources. #["doc/dnst.1", "usr/share/man/man1/dnst.1", "644"], From 69dd0c762d54dfd00cf7fa5ba2de2b2f448db3f5 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:53:45 +0100 Subject: [PATCH 08/23] And without preserve-symlinks? --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fbfc4c6..8b5fbe1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ assets = [ ] changelog = "target/debian/changelog" # this will be generated by the pkg workflow copyright = "Copyright (c) 2024, NLnet Labs. All rights reserved." -preserve-symlinks = true +#preserve-symlinks = true [package.metadata.generate-rpm] # "BSD" alone is the 3-clause license. Inheriting "license" from above causes rpmlint to From b5dc5b40a5844bef28571e77d01b737f3e1756ed Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:01:58 +0100 Subject: [PATCH 09/23] Try maintainer scripts for creating symlinks instead. --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8b5fbe1..5eb77d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,14 +33,17 @@ section = "net" priority = "optional" assets = [ ["target/release/dnst", "usr/bin/", "755"], - ["pkg/links/ldns-nsec3-hash", "usr/bin/", "777"], ["README.md", "usr/share/doc/dnst/", "644"], # TODO: Extend Ploutos to generate the man pages from sources. #["doc/dnst.1", "usr/share/man/man1/dnst.1", "644"], ] changelog = "target/debian/changelog" # this will be generated by the pkg workflow copyright = "Copyright (c) 2024, NLnet Labs. All rights reserved." +# preserve_symlinks didn't prevent error "Asset file path does not match any files" +# Perhaps a newer version of cargo-deb than the one used by Ploutos would fix this. +# Instead create and remove them using maintainer scripts. #preserve-symlinks = true +maintainer-scripts = "pkg/debian" [package.metadata.generate-rpm] # "BSD" alone is the 3-clause license. Inheriting "license" from above causes rpmlint to From 43440ec9bed5100e60cfa4cce0b3bbc444d43e85 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:07:30 +0100 Subject: [PATCH 10/23] Invert ln args. Use scripts for symlink creation for RPMs too. --- .github/workflows/pkg.yml | 2 +- Cargo.toml | 1 - pkg/debian/postinst | 2 +- pkg/debian/postrm | 1 + pkg/rpm/scriptlets.toml | 2 ++ 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 9eff26f..9a865a9 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -25,4 +25,4 @@ jobs: package_build_rules: pkg/rules/packages-to-build.yml package_test_scripts_path: pkg/test-scripts/test-.sh - #rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file + rpm_scriptlets_path: pkg/rpm/scriptlets.toml \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 5eb77d4..508d593 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,6 @@ maintainer-scripts = "pkg/debian" license = "BSD" assets = [ { source = "target/release/dnst", dest = "/usr/bin/dnst", mode = "755" }, - { source = "pkg/links/ldns-nsec3-hash", dest = "/usr/bin/ldns-nsec3-hash", mode = "744" }, # TODO: Extend Ploutos to generate the man pages from sources. #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, ] diff --git a/pkg/debian/postinst b/pkg/debian/postinst index b470b60..bc62870 100644 --- a/pkg/debian/postinst +++ b/pkg/debian/postinst @@ -3,6 +3,6 @@ case "$1" in configure) # Create symbolic links - ln -s /usr/bin/ldns-nsec3-hash /usr/bin/dnst + ln -s /usr/bin/dnst /usr/bin/ldns-nsec3-hash ;; esac \ No newline at end of file diff --git a/pkg/debian/postrm b/pkg/debian/postrm index 745620f..246bcc5 100644 --- a/pkg/debian/postrm +++ b/pkg/debian/postrm @@ -3,5 +3,6 @@ case "$1" in purge) # Remove symbolic links + rm -f /usr/bin/ldns-nsec3-hash ;; esac \ No newline at end of file diff --git a/pkg/rpm/scriptlets.toml b/pkg/rpm/scriptlets.toml index 1ebad27..9886bd9 100644 --- a/pkg/rpm/scriptlets.toml +++ b/pkg/rpm/scriptlets.toml @@ -4,6 +4,7 @@ post_install_script = ''' if [ $1 -eq 1 ] ; then # Initial installation # Create symbolic links + ln -s /usr/bin/dnst /usr/bin/ldns-nsec3-hash fi ''' @@ -13,5 +14,6 @@ post_uninstall_script = ''' if [ $1 -ge 1 ] ; then # Remove symbolic links + rm -f /usr/bin/ldns-nsec3-hash fi ''' \ No newline at end of file From 3d5373d1946d37e07a4217942594a21c181ef399 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:37:16 +0100 Subject: [PATCH 11/23] FIX: -V/--version output shouldn't output the module prefix or set the exit code to non-zero. --- Cargo.toml | 2 +- src/commands/mod.rs | 5 +++++ src/commands/version.rs | 12 ++++++++++++ src/lib.rs | 12 +++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/commands/version.rs diff --git a/Cargo.toml b/Cargo.toml index 508d593..ebc1d1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ path = "src/bin/ldns.rs" [dependencies] arbitrary = { version = "1", optional = true, features = ["derive"] } -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["cargo", "derive"] } #domain = "0.10.3" domain = { git = "https://github.com/NLnetLabs/domain/", branch = "initial-nsec3-generation", features = ["ring", "unstable-validator"] } lexopt = "0.3.0" diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 6379a27..c1740ee 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,6 +1,7 @@ //! The command of _dnst_. pub mod help; pub mod nsec3hash; +pub mod version; use std::ffi::{OsStr, OsString}; use std::io::Write; @@ -20,6 +21,9 @@ pub enum Command { /// Show the manual pages Help(self::help::Help), + + /// Show the application version + Version(self::version::Version), } impl Command { @@ -27,6 +31,7 @@ impl Command { match self { Self::Nsec3Hash(nsec3hash) => nsec3hash.execute(writer), Self::Help(help) => help.execute(), + Self::Version(version) => version.execute(writer), } } } diff --git a/src/commands/version.rs b/src/commands/version.rs new file mode 100644 index 0000000..630df66 --- /dev/null +++ b/src/commands/version.rs @@ -0,0 +1,12 @@ +use std::io::Write; + +use crate::error::Error; + +#[derive(Clone, Debug, clap::Args)] +pub struct Version; + +impl Version { + pub fn execute(self, writer: &mut W) -> Result<(), Error> { + writeln!(writer, clap::crate_version!()).map_err(Into::into) + } +} diff --git a/src/lib.rs b/src/lib.rs index fc0298e..805ef0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,8 @@ use std::{ffi::OsString, path::Path}; use clap::Parser; use args::Args; +use clap::error::ErrorKind; +use commands::Command; use commands::{nsec3hash::Nsec3Hash, LdnsCommand}; use error::Error; @@ -14,7 +16,15 @@ pub fn parse_args, T: Fn() -> I>( args_provider: T, ) -> Result { try_ldns_compatibility(args_provider()).or_else(|_| { - Args::try_parse_from(args_provider()).map_err(|err| Error::new(err.to_string().as_str())) + match Args::try_parse_from(args_provider()) { + Err(err) if err.kind() == ErrorKind::DisplayVersion => Ok(Args::from( + Command::Version(crate::commands::version::Version), + )), + + Err(err) => Err(Error::new(err.to_string().as_str())), + + Ok(args) => Ok(args), + } }) } From 46d46dbbd32bc534b149c6660300c1fd8b860b39 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:50:16 +0100 Subject: [PATCH 12/23] Remove unused symlink. --- pkg/links/ldns-nsec3-hash | 1 - 1 file changed, 1 deletion(-) delete mode 120000 pkg/links/ldns-nsec3-hash diff --git a/pkg/links/ldns-nsec3-hash b/pkg/links/ldns-nsec3-hash deleted file mode 120000 index 3487f80..0000000 --- a/pkg/links/ldns-nsec3-hash +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/dnst \ No newline at end of file From 2caa3a60d1822555af0e3490cfd11b43ccf57481 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:51:06 +0100 Subject: [PATCH 13/23] Fix upgrade failure due to existing sym link. --- pkg/debian/prerm | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 pkg/debian/prerm diff --git a/pkg/debian/prerm b/pkg/debian/prerm new file mode 100644 index 0000000..44a179b --- /dev/null +++ b/pkg/debian/prerm @@ -0,0 +1,8 @@ +#!/bin/sh -e + +case "$1" in +upgrade) + # Remove symbolic links + rm -f /usr/bin/ldns-nsec3-hash + ;; +esac \ No newline at end of file From d3884fec185f6b9c5b362954e4b9e2afae555d41 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:07:05 +0100 Subject: [PATCH 14/23] Remove symlinks in prerm, not postrm, to attempt to fix package upgrade. --- pkg/debian/postrm | 8 -------- pkg/debian/prerm | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 pkg/debian/postrm diff --git a/pkg/debian/postrm b/pkg/debian/postrm deleted file mode 100644 index 246bcc5..0000000 --- a/pkg/debian/postrm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -e - -case "$1" in -purge) - # Remove symbolic links - rm -f /usr/bin/ldns-nsec3-hash - ;; -esac \ No newline at end of file diff --git a/pkg/debian/prerm b/pkg/debian/prerm index 44a179b..5644fb2 100644 --- a/pkg/debian/prerm +++ b/pkg/debian/prerm @@ -1,7 +1,7 @@ #!/bin/sh -e case "$1" in -upgrade) +upgrade|remove) # Remove symbolic links rm -f /usr/bin/ldns-nsec3-hash ;; From be163b6140c52088ab676b41b0c4494c0741cdc8 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:21:31 +0100 Subject: [PATCH 15/23] Overwrite existing symlinks on RPM upgrade. --- pkg/rpm/scriptlets.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/rpm/scriptlets.toml b/pkg/rpm/scriptlets.toml index 9886bd9..b2d4200 100644 --- a/pkg/rpm/scriptlets.toml +++ b/pkg/rpm/scriptlets.toml @@ -1,18 +1,22 @@ post_install_script = ''' #!/bin/bash -e -if [ $1 -eq 1 ] ; then - # Initial installation - # Create symbolic links - ln -s /usr/bin/dnst /usr/bin/ldns-nsec3-hash +FORCE= +if [ $1 -eq 2 ]; then + # Upgrade + FORCE=-f fi + +# Create symbolic links +ln -s ${FORCE} /usr/bin/dnst /usr/bin/ldns-nsec3-hash ''' post_uninstall_script = ''' #!/bin/bash -e #RPM_SYSTEMD_MACROS# -if [ $1 -ge 1 ] ; then +if [ $1 -eq 0 ] ; then + # Uninstallation # Remove symbolic links rm -f /usr/bin/ldns-nsec3-hash fi From ed7d058495a5b52f4d018b91e049f23cb8ed72df Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:38:34 +0100 Subject: [PATCH 16/23] Instruct package managers that dnst replaces/obsoletes ldns utilities. --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ebc1d1f..5cb9e2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ copyright = "Copyright (c) 2024, NLnet Labs. All rights reserved." # Instead create and remove them using maintainer scripts. #preserve-symlinks = true maintainer-scripts = "pkg/debian" +replaces = "ldnsutils" [package.metadata.generate-rpm] # "BSD" alone is the 3-clause license. Inheriting "license" from above causes rpmlint to @@ -55,6 +56,7 @@ assets = [ # TODO: Extend Ploutos to generate the man pages from sources. #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, ] +obsoletes = [ "ldns-utils" ] # These get set using cargo-generate-rpm --set-metadata at package build time. #post_install_script = ... #pre_uninstall_script = ... From 6601204393ee030b5fa898fc33d8f786643ba20f Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:43:29 +0100 Subject: [PATCH 17/23] cargo-generate-rpm obsoletes must be a string. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5cb9e2b..ca6fe2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ assets = [ # TODO: Extend Ploutos to generate the man pages from sources. #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, ] -obsoletes = [ "ldns-utils" ] +obsoletes = "ldns-utils" # These get set using cargo-generate-rpm --set-metadata at package build time. #post_install_script = ... #pre_uninstall_script = ... From 32bd39cfbf1fe0db2c9c46a2258b73c1124576b1 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:53:01 +0100 Subject: [PATCH 18/23] cargo-generate-rpm obsoletes must be a string: second attempt (the code says it has to be a table). --- Cargo.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ca6fe2c..5ebf1df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,8 +56,11 @@ assets = [ # TODO: Extend Ploutos to generate the man pages from sources. #{ source = "doc/routinator.1", dest = "/usr/share/man/man1/routinator.1", mode = "644", doc = true }, ] -obsoletes = "ldns-utils" + # These get set using cargo-generate-rpm --set-metadata at package build time. #post_install_script = ... #pre_uninstall_script = ... -#post_uninstall_script = ... \ No newline at end of file +#post_uninstall_script = ... + +[package.metadata.generate-rpm.obsoletes] +ldns-utils = "*" From 5937ad795646b698237a2cbbbaef54b579673f7b Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 01:08:22 +0100 Subject: [PATCH 19/23] Use conflicts instead of replaces because uninstall of obsolete ldns utils package happens (with RPMs) after install of dnst, so dnst install failts to create sym links. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5ebf1df..4cf8505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ copyright = "Copyright (c) 2024, NLnet Labs. All rights reserved." # Instead create and remove them using maintainer scripts. #preserve-symlinks = true maintainer-scripts = "pkg/debian" -replaces = "ldnsutils" +conflicts = "ldnsutils" [package.metadata.generate-rpm] # "BSD" alone is the 3-clause license. Inheriting "license" from above causes rpmlint to @@ -62,5 +62,5 @@ assets = [ #pre_uninstall_script = ... #post_uninstall_script = ... -[package.metadata.generate-rpm.obsoletes] +[package.metadata.generate-rpm.conflicts] ldns-utils = "*" From 7dd9ffbbafcdb5b6a09cbf17165282002530f90d Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:47:12 +0100 Subject: [PATCH 20/23] FIX: ldns-xxx parse error should not cause dnst command to be tried. --- src/bin/ldns.rs | 4 +++- src/lib.rs | 25 ++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/bin/ldns.rs b/src/bin/ldns.rs index aa1c63f..b1bee09 100644 --- a/src/bin/ldns.rs +++ b/src/bin/ldns.rs @@ -22,5 +22,7 @@ fn main() -> ExitCode { fn run() -> Result<(), Error> { let mut args = std::env::args_os(); args.next().unwrap(); - try_ldns_compatibility(args)?.execute(&mut std::io::stdout()) + try_ldns_compatibility(args) + .ok_or("Unrecognised ldns command")?? + .execute(&mut std::io::stdout()) } diff --git a/src/lib.rs b/src/lib.rs index 805ef0d..f0906ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ use error::Error; pub fn parse_args, T: Fn() -> I>( args_provider: T, ) -> Result { - try_ldns_compatibility(args_provider()).or_else(|_| { + try_ldns_compatibility(args_provider()).unwrap_or_else(|| { match Args::try_parse_from(args_provider()) { Err(err) if err.kind() == ErrorKind::DisplayVersion => Ok(Args::from( Command::Version(crate::commands::version::Version), @@ -28,20 +28,15 @@ pub fn parse_args, T: Fn() -> I>( }) } -pub fn try_ldns_compatibility>(args: I) -> Result { +pub fn try_ldns_compatibility>( + args: I, +) -> Option> { let mut args_iter = args.into_iter(); - let binary_path = args_iter - .next() - .ok_or::("Missing binary name".into())?; - - let binary_name = Path::new(&binary_path) - .file_name() - .ok_or::("Missing binary file name".into())? - .to_str() - .ok_or("Binary file name is not valid Unicode")?; - - match binary_name { - "ldns-nsec3-hash" => Nsec3Hash::parse_ldns_args(args_iter), - _ => Err("Unrecognised LDNS command".into()), + let binary_path = args_iter.next()?; + let binary_name = Path::new(&binary_path).file_name()?; + + match binary_name.to_string_lossy().to_string().as_str() { + "ldns-nsec3-hash" => Some(Nsec3Hash::parse_ldns_args(args_iter)), + _ => None, } } From 19ef71ffcf2998008468e9e39d406edc4495d602 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:25:38 +0100 Subject: [PATCH 21/23] Add a dnst docker image. --- .dockerignore | 2 + .github/workflows/pkg.yml | 8 +-- Dockerfile | 147 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cf2c04e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/target +.git diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 9a865a9..e26cfec 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -17,10 +17,10 @@ jobs: # DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }} # DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} with: - # docker_org: nlnetlabs - # docker_repo: routinator - # docker_build_rules: pkg/rules/docker-images-to-build.yml - # docker_sanity_check_command: --version + docker_org: nlnetlabs + docker_repo: dnst + docker_build_rules: pkg/rules/docker-images-to-build.yml + docker_sanity_check_command: --version package_build_rules: pkg/rules/packages-to-build.yml package_test_scripts_path: pkg/test-scripts/test-.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7c85ded --- /dev/null +++ b/Dockerfile @@ -0,0 +1,147 @@ +# This is a multi-stage Dockerfile, with a selectable first stage. With this +# approach we get: +# +# 1. Separation of dependencies needed to build our app in the 'build' stage +# and those needed to run our app in the 'final' stage, as we don't want +# the build-time dependencies to be included in the final Docker image. +# +# 2. Support for either building our app for the architecture of the base +# image using MODE=build (the default) or for externally built app +# binaries (e.g. cross-compiled) using MODE=copy. +# +# In total there are four stages consisting of: +# - Two possible first stages: 'build' or 'copy'. +# - A special 'source' stage which selects either 'build' or 'copy' as the +# source of binaries to be used by ... +# - The 'final' stage. + + +### +### ARG DEFINITIONS ########################################################### +### + +# This section defines arguments that can be overriden on the command line +# when invoking `docker build` using the argument form: +# +# `--build-arg =`. + +# MODE +# ==== +# Supported values: build (default), copy +# +# By default this Dockerfile will build our app from sources. If the sources +# have already been (cross) compiled by some external process and you wish to +# use the resulting binaries from that process, then: +# +# 1. Create a directory on the host called 'dockerbin/$TARGETPLATFORM' +# containing the already compiled app binaries (where $TARGETPLATFORM +# is a special variable set by Docker BuiltKit). +# 2. Supply arguments `--build-arg MODE=copy` to `docker build`. +ARG MODE=build + + +# BASE_IMG +# ======== +# +# Only used when MODE=build. +ARG BASE_IMG=alpine:3.20 + + +# CARGO_ARGS +# ========== +# +# Only used when MODE=build. +# +# This ARG can be used to control the features enabled when compiling the app +# or other compilation settings as necessary. +ARG CARGO_ARGS + + +### +### BUILD STAGES ############################################################## +### + + +# ----------------------------------------------------------------------------- +# Docker stage: build +# ----------------------------------------------------------------------------- +# +# Builds our app binaries from sources. +FROM ${BASE_IMG} AS build +ARG CARGO_ARGS + +RUN apk add --no-cache rust cargo + +WORKDIR /tmp/build +COPY . . + +# `CARGO_HTTP_MULTIPLEXING` forces Cargo to use HTTP/1.1 without pipelining +# instead of HTTP/2 with multiplexing. This seems to help with various +# "spurious network error" warnings when Cargo attempts to fetch from crates.io +# when building this image on Docker Hub and GitHub Actions build machines. +# +# `cargo install` is used instead of `cargo build` because it places just the +# binaries we need into a predictable output directory. We can't control this +# with arguments to cargo build as `--out-dir` is unstable and contentious and +# `--target-dir` still requires us to know which profile and target the +# binaries were built for. By using `cargo install` we can also avoid needing +# to hard-code the set of binary names to copy so that if we add or remove +# built binaries in future this will "just work". Note that `--root /tmp/out` +# actually causes the binaries to be placed in `/tmp/out/bin/`. `cargo install` +# will create the output directory for us. +RUN CARGO_HTTP_MULTIPLEXING=false cargo install \ + --locked \ + --path . \ + --root /tmp/out/ \ + ${CARGO_ARGS} + + +# ----------------------------------------------------------------------------- +# Docker stage: copy +# ----------------------------------------------------------------------------- +# Only used when MODE=copy. +# +# Copy binaries from the host directory 'dockerbin/$TARGETPLATFORM' directory +# into this build stage to the same predictable location that binaries would be +# in if MODE were 'build'. +# +# Requires that `docker build` be invoked with variable `DOCKER_BUILDKIT=1` set +# in the environment. This is necessary so that Docker will skip the unused +# 'build' stage and so that the magic $TARGETPLATFORM ARG will be set for us. +FROM ${BASE_IMG} AS copy +ARG TARGETPLATFORM +ONBUILD COPY dockerbin/$TARGETPLATFORM /tmp/out/bin/ + + +# ----------------------------------------------------------------------------- +# Docker stage: source +# ----------------------------------------------------------------------------- +# This is a "magic" build stage that "labels" a chosen prior build stage as the +# one that the build stage after this one should copy application binaries +# from. It also causes the ONBUILD COPY command from the 'copy' stage to be run +# if needed. Finally, we ensure binaries have the executable flag set because +# when copied in from outside they may not have the flag set, especially if +# they were uploaded as a GH actions artifact then downloaded again which +# causes file permissions to be lost. +# See: https://github.com/actions/upload-artifact#permission-loss +FROM ${MODE} AS source +RUN chmod a+x /tmp/out/bin/* + + +# ----------------------------------------------------------------------------- +# Docker stage: final +# ----------------------------------------------------------------------------- +# Create an image containing just the binaries, configs & scripts needed to run +# our app, and not the things needed to build it. +# +# The previous build stage from which binaries are copied is controlled by the +# MODE ARG (see above). +FROM ${BASE_IMG} AS final + +# Copy binaries from the 'source' build stage into the image we are building +COPY --from=source /tmp/out/bin/* /usr/local/bin/ + +# Use Tini to ensure that our application responds to CTRL-C when run in the +# foreground without the Docker argument "--init" (which is actually another +# way of activating Tini, but cannot be enabled from inside the Docker image). +ENTRYPOINT ["/sbin/tini", "--", "dnst"] From 5cd885bcbeb165bc8fe8d1527816c65bb9ee9abf Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:33:36 +0100 Subject: [PATCH 22/23] Oops, add tini. --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7c85ded..b653bd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -141,6 +141,9 @@ FROM ${BASE_IMG} AS final # Copy binaries from the 'source' build stage into the image we are building COPY --from=source /tmp/out/bin/* /usr/local/bin/ +# Install required runtime dependencies +RUN apk add --no-cache tini + # Use Tini to ensure that our application responds to CTRL-C when run in the # foreground without the Docker argument "--init" (which is actually another # way of activating Tini, but cannot be enabled from inside the Docker image). From 771ce14a4a4c364fb61eb8358070461add26f656 Mon Sep 17 00:00:00 2001 From: Ximon Eighteen <3304436+ximon18@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:37:14 +0100 Subject: [PATCH 23/23] We need libgcc too. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b653bd3..73b69e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -142,7 +142,7 @@ FROM ${BASE_IMG} AS final COPY --from=source /tmp/out/bin/* /usr/local/bin/ # Install required runtime dependencies -RUN apk add --no-cache tini +RUN apk add --no-cache libgcc tini # Use Tini to ensure that our application responds to CTRL-C when run in the # foreground without the Docker argument "--init" (which is actually another