New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Arch Linux Dockerfiles #15
Add support for Arch Linux Dockerfiles #15
Conversation
007aa9b
to
00325ea
Compare
|
I fixed the signature error, |
00325ea
to
de206eb
Compare
de206eb
to
5f079db
Compare
24d69c1
to
cc301d1
Compare
| set -eux -o pipefail; \ | ||
| export SOURCE_DATE_EPOCH="$(stat --format=%Y /etc/pacman.conf)" && \ | ||
| mkdir -p /out && \ | ||
| pacman -Sy && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be executed with https://archive.archlinux.org/repos/yyyy/MM/dd that corresponds to the SOURCE_DATE_EPOCH .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but in practice I would most likely want to override this to get the latest security patches when updating my SHA256SUMS file. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default mode should maximize reproducibility/non-determinism, but having an ARG option to get the latest updates sounds good as well
| pacman-key --init && \ | ||
| /usr/local/bin/repro-get --provider="${REPRO_GET_PROVIDER}" --cache=/dev/.cache/repro-get install "/mnt/SHA256SUMS-${TARGETARCH}${TARGETVARIANT:+-${TARGETVARIANT}}" && \ | ||
| : Remove unneeded files for reproducibility && \ | ||
| rm -rf /etc/pacman.d/gnupg && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pacman-key is a thin wrapper around gnupg, and instead of "trust every key in our keyring package" it evaluates the pgp web-of-trust client side during an upgrade to ensure every packager key is trusted by multiple Arch Linux master keys (as a defense in depth mechanism, Debian and Alpine are more pragmatic in that regard).
To process this graph, gnupg needs to use lsign and to do that it needs access to a private key (that's what pacman-key --init does, among other things). This key should not remain in the final image tho, leaking the private key while the public key is also still trusted in the final image would be very bad, for that reason it's best to just nuke the whole folder that contains the pgp web-of-trust stuff after we're done with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, could you add that explanation to the comment lines in Dockerfile.tmpl ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: kpcyrd <git@rxv.cc>
cc301d1
to
206c7ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
It's half-working, it currently fails with this error:
I'm not sure why, adding
pacman-key -l 0429897DE5F3BDAC537A30696D42BDD116E0068Fto the Dockerfile shows that the key is present, yetpacman-key --verifyis failing.