mirror of
https://github.com/klutchell/unbound-docker.git
synced 2026-10-15 16:02:46 +00:00
Update steps to generate root.hints and root.key
Signed-off-by: Kyle Harding <kyle@balena.io>
This commit is contained in:
+24
-10
@@ -50,27 +50,20 @@ People _love_ thorough bug reports. I'm not even kidding.
|
||||
|
||||
## Building
|
||||
|
||||
1. Optionally update root hints before building
|
||||
|
||||
```bash
|
||||
rm rootfs_overlay/var/unbound/root.hints
|
||||
wget https://www.internic.net/domain/named.root -O rootfs_overlay/var/unbound/root.hints
|
||||
```
|
||||
|
||||
2. Enable docker buildkit and experimental mode
|
||||
1. Enable docker buildkit and experimental mode
|
||||
|
||||
```bash
|
||||
export DOCKER_BUILDKIT=1
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
```
|
||||
|
||||
3. Build image for host architecture
|
||||
2. Build image for host architecture
|
||||
|
||||
```bash
|
||||
docker build . --tag klutchell/unbound:dev
|
||||
```
|
||||
|
||||
4. Optionally cross-build for another architecture
|
||||
3. Optionally cross-build for another architecture
|
||||
|
||||
```bash
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
@@ -128,6 +121,27 @@ docker build . --target conf-example --output rootfs_overlay/etc/unbound/
|
||||
|
||||
[Here](https://github.com/klutchell/unbound-docker/pull/235) is an example pull request for reference.
|
||||
|
||||
## Updating root.hints and root.key
|
||||
|
||||
These files should be updated once a year or so to ensure they have the latest valid information.
|
||||
|
||||
1. In your working copy, create a new branch if you haven't already.
|
||||
|
||||
2. Enable docker buildkit and experimental mode
|
||||
|
||||
```bash
|
||||
export DOCKER_BUILDKIT=1
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
```
|
||||
|
||||
3. Run the following build command to generate new files.
|
||||
|
||||
```bash
|
||||
docker build . --target root-hints --output rootfs_overlay/var/unbound/
|
||||
```
|
||||
|
||||
4. Commit changes in `root_overlay/var/unbound/*` and open a pull request for review.
|
||||
|
||||
## License
|
||||
|
||||
By contributing, you agree that your contributions will be licensed under its [Software License](LICENSE.md).
|
||||
|
||||
+13
@@ -95,11 +95,24 @@ RUN make -j"$(nproc)" && \
|
||||
/opt/usr/sbin/unbound-control \
|
||||
/opt/usr/sbin/unbound-host
|
||||
|
||||
WORKDIR /var/unbound/
|
||||
|
||||
# download root hints and generate initial root key
|
||||
# https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound-anchor.html
|
||||
RUN wget -q https://www.internic.net/domain/named.root -O root.hints \
|
||||
&& { /opt/usr/sbin/unbound-anchor -v -r root.hints 2>&1 || true ; } | tee -a /dev/stderr | grep -q "success: the anchor is ok"
|
||||
|
||||
FROM scratch AS conf-example
|
||||
|
||||
# docker build . --target conf-example --output rootfs_overlay/etc/unbound/
|
||||
COPY --from=unbound /etc/unbound/unbound.conf /unbound.conf.example
|
||||
|
||||
FROM scratch as root-hints
|
||||
|
||||
# docker build . --target root-hints --output rootfs_overlay/var/unbound/
|
||||
COPY --from=unbound /var/unbound/root.key /root.key
|
||||
COPY --from=unbound /var/unbound/root.hints /root.hints
|
||||
|
||||
FROM scratch AS final
|
||||
|
||||
COPY --from=build-base /lib/ld-musl*.so.1 /lib/
|
||||
|
||||
Reference in New Issue
Block a user