I am trying to rebuild the reverse proxy of
jwilder/nginx-proxy:alpine on my Raspberry Pi 4 running Raspbian 10.
As the container is not configured for
armhf architectures, I tweaked the
Dockerfile using the
I am able to build the container, but it returns the error
standard_init_linux.go:211: exec user process caused "exec format error" when I run it.
Googling around let me assume that some part of the process load a binary that wasn't built for the armhf architecture. But I am not able pinpoint the error or fix it.
I also tried to replicate the steps in an interactive session
docker run -it --rm arm32v7/nginx:latest bash (specifically, I was able to get
forego to run and print their versions (0.7.4 and dev)) and wasn't able to replicate the issue, i.e., the individual steps seem to work and didn't throw the error.
Any idea what causes the error and how to fix it?
Most of this is copied from the original Dockerfile of
jwilder/nginx-proxy with a different base nginx container, as well as some minor tweaks to installing docker-gen and forego, and copying the
uploadsize.conf from the nextcloud example (see below).
All changes are commented with a
Note I also have the respective files
at the same path as the Dockerfile.
# Replicating jwilder/nginx-proxy:alpine #> Changed to the right architecture for the pi 4 FROM arm32v7/nginx:latest # Install wget and install/updates certificates RUN apt-get update \ && apt-get install -y -q --no-install-recommends \ ca-certificates \ wget \ && apt-get clean \ && rm -r /var/lib/apt/lists/* # Configure Nginx and apply fix for very long server names RUN echo "daemon off;" >> /etc/nginx/nginx.conf \ && sed -i 's/worker_processes 1/worker_processes auto/' /etc/nginx/nginx.conf # Install Forego #> Changed forego install process to an armhf architecture RUN wget -q https://github.com/djmaze/armhf-forego/releases/download/v0.16.1/forego -O /usr/local/bin/forego RUN chmod u+x /usr/local/bin/forego # Install docker-gen #> Changed Version number and platform to the newest and armhf version ENV DOCKER_GEN_VERSION 0.7.4 ENV DOCKER_PLATFORM armhf RUN wget -q -O - https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-$DOCKER_PLATFORM-$DOCKER_GEN_VERSION.tar.gz \ | tar -C /usr/local/bin -xvz COPY network_internal.conf /etc/nginx/ #> included from the nextcloud example COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf COPY . /app/ WORKDIR /app/ ENV DOCKER_HOST unix:///tmp/docker.sock VOLUME ["/etc/nginx/certs", "/etc/nginx/dhparam"] ENTRYPOINT ["/app/docker-entrypoint.sh"] CMD ["forego", "start", "-r"]
docker build -t reverse-proxy . # works as expected docker run reverse-proxy # fails with the error > standard_init_linux.go:211: exec user process caused "exec format error"
Avoiding the XY-Problem
The ultimate goal is to use docker to run nextcloud and pihole on my raspberry pi. The reverse proxy is used by nextcloud's examples to hide the different service (postgres, nextcloud, etc) behind the reverse proxy.
If you know any way to do this without the reverse proxy, I'd be happy to listen. Any help is appreciated!