Can’t figure why this happens. I’m trying to create a docker image with base pihole and include unbound in it. I have it working for ages with the pihole 5.x-version but the development-v6 running on alpine is giving the following through buildx:
Dockerfile_v6:21
--------------------
19 | RUN apk add openrc
20 | RUN rc-update add unbound default
21 | >>> RUN /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key
22 | # RUN touch /run/openrc/softlevel
23 |
--------------------
ERROR: failed to solve: process "/bin/sh -c /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key" did not complete successfully: exit code: 1
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key" did not complete successfully: exit code: 1
folder /var/lib/unbound is created before and chowned with unbound.
Added /usr/sbin before the executable as without it was also causing trouble.
If I use a base pihole-image and run the container I can run the commands. Even got pihole and unbound running with pihole v6 at the moment.
Contents from the Dockerfile_v6:
# development-v6-image
ARG PIHOLE_VERSION
FROM pihole/pihole:development-v6
# COPY debian_testing.list /etc/apt/sources.list.d/
# RUN apt update && apt install -y -f openssl net-tools unbound openssh-server
RUN apk add unbound
# directories made later as chown won't work before apk add unbound
RUN mkdir -p /var/log/unbound && mkdir -p /var/lib/unbound
RUN chown -R unbound:unbound /var/log/unbound && chown -R unbound:unbound /var/lib/unbound
# rc-stuff
RUN apk add openrc
RUN rc-update add unbound default
RUN /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key
# RUN touch /run/openrc/softlevel