fnazz/docker-adguard-unbound-wireguard

exec /unbound.sh: exec format error

Opened this issue · 2 comments

Hi,

Environment - OCI VPS VM.Standard.A1.Flex 2 OCPU, 12 GB, Ubuntu 20.04. Followed the pre-req and install instructions.
Adguard and Wireguard work. Unbound comes up with:

unbound exited with code 1
unbound | exec /unbound.sh: exec format error
unbound | exec /unbound.sh: exec format error
unbound | exec /unbound.sh: exec format error
unbound | exec /unbound.sh: exec format error
and

`ubuntu@123:~/docker-adguard-unbound-wireguard$ sudo docker-compose ps
Name Command State Ports

adguard /opt/adguardhome/AdGuardHo ... Up 3000/tcp, 3000/udp, 3001/tcp, 3001/udp, 443/tcp, 443/udp, 53/tcp, 53/udp, 5443/tcp,
5443/udp, 6060/tcp, 67/udp, 68/udp, 784/udp, 80/tcp, 853/tcp, 853/udp, 8853/udp
unbound /unbound.sh Restarting
wireguard /init Up 0.0.0.0:51820->51820/udp,:::51820->51820/udp'

EDIT add:
ubuntu@123:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 24583/sshd: ubuntu@
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 918/sshd: /usr/sbin
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/init
tcp6 0 0 ::1:6010 :::* LISTEN 24583/sshd: ubuntu@
tcp6 0 0 :::22 :::* LISTEN 918/sshd: /usr/sbin
tcp6 0 0 :::111 :::* LISTEN 1/init
udp 0 0 0.0.0.0:51820 0.0.0.0:* 1294/docker-proxy
udp 0 0 10.0.0.223:68 0.0.0.0:* 765/systemd-network
udp 0 0 0.0.0.0:111 0.0.0.0:* 1/init
udp6 0 0 :::51820 :::* 1300/docker-proxy
udp6 0 0 :::111 :::* 1/init

Any suggestion?
Thank you

I encountered the same issue. Here's a summary of how I resolved it:

I am using an ARM-based Oracle Cloud Free Tier instance. To address the issue, I followed these steps:

  1. Cloning the Repository:

    I cloned the unbound-docker repository from GitHub:

    git clone https://github.com/MatthewVance/unbound-docker
  2. Building the Docker Image:

    Navigate to the directory containing the Dockerfile and build the Docker image:

    docker build -t unbound .

    Make sure you are in the correct directory where the Dockerfile is located.

  3. Resolving GPG Key Issues:

    While building the unbound image, I encountered errors related to GPG keys. To resolve this, I modified the Dockerfile as follows:

    RUN set -e -x && \
        build_deps="build-essential ca-certificates curl dirmngr gnupg libidn2-0-dev libssl-dev" && \
        DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
          $build_deps && \
        curl -L $SOURCE_OPENSSL$VERSION_OPENSSL.tar.gz -o openssl.tar.gz && \
        echo "${SHA256_OPENSSL} ./openssl.tar.gz" | sha256sum -c - && \
        curl -L $SOURCE_OPENSSL$VERSION_OPENSSL.tar.gz.asc -o openssl.tar.gz.asc && \
        GNUPGHOME="$(mktemp -d)" && \
        export GNUPGHOME && \
        ( gpg --no-tty --keyserver keyserver.ubuntu.com --recv-keys "$OPGP_OPENSSL" \
        || gpg --no-tty --keyserver keys.openpgp.org --recv-keys "$OPGP_OPENSSL" ) && \
        gpg --batch --verify openssl.tar.gz.asc openssl.tar.gz && \
        tar xzf openssl.tar.gz && \
        cd $VERSION_OPENSSL && \
        ./config --prefix=/opt/openssl no-weak-ssl-ciphers no-ssl3 no-shared enable-ec_nistp_64_gcc_128 -DOPENSSL_NO_HEARTBEATS -fstack-protector-strong && \
        make depend && \
        nproc | xargs -I % make -j% && \
        make install_sw && \
        apt-get purge -y --auto-remove \
          $build_deps && \
        rm -rf \
            /tmp/* \
            /var/tmp/* \
            /var/lib/apt/lists/*
    

    This change addressed the GPG key verification issues and allowed the build to complete successfully.

  4. Updating docker-compose.yml:

    I updated the docker-compose.yml file to use my custom-built image:

    Before:

      unbound:
        image: "mvance/unbound:latest"
        container_name: unbound
        restart: unless-stopped
        hostname: "unbound"
        volumes:
          - "./unbound:/opt/unbound/etc/unbound/"
        networks:
          private_network:
            ipv4_address: 10.2.0.200

    After:

      unbound:
        image: "unbound:latest"
        container_name: unbound
        restart: unless-stopped
        hostname: "unbound"
        volumes:
          - "./unbound:/opt/unbound/etc/unbound/"
        networks:
          private_network:
            ipv4_address: 10.2.0.200

    After making this update, I rebuilt the Docker Compose setup, and it worked as expected.

For additional guidance, I recommend this tutorial: YouTube Tutorial.

I hope this helps!

use an ARM docker image for unbound, pedantic/unbound should work, you can set the volumes like this

 volumes:
      - type: bind
        read_only: true
        source: ./unbound/unbound.conf
        target: /opt/unbound/etc/unbound/unbound.conf

You can also use this fork instead. docker-adguard-unbound-wireguard-oci