Problems with tobi312/rpi-nginx image

Hi there,
I have a fleet of pi3 running NGINX with the following image:
https://hub.docker.com/r/tobi312/rpi-nginx

Everything worked as expected for months but this morning I got the following error while compiling a new build with “git push balena master”

Any ideas why it’s picking up the wrong architecture?
Any help would be very appreciated,
many thanks,
enrico

Hi there, would you be able to post your Dockerfile so I can try and reproduce the issue?

Hi there, thanks for looking into it.
Please follow our docker compose:

 version: '2'
volumes: 
    resin-data:
services:
  node:
    build: ./node
    expose:
      - "8080"
      - "631"
    volumes: 
      - 'resin-data:/data'
    privileged: true
    restart: always
    network_mode: host
    environment:
      - UDEV=on
    devices:
      - '/dev:/dev'
  nginx:
    build: ./nginx
    depends_on:
      - node
    ports:
      - "80"
    privileged: true
    restart: always
    network_mode: host
    environment:
      - UDEV=on

Docker template /nginx/dockerfile.template:

FROM tobi312/rpi-nginx

RUN apt-get update && \
    apt-get install telnet nano iputils-ping less kmod nano net-tools ifupdown i2c-tools usbutils wget curl gvfs ipheth-utils  gvfs-backends gvfs-bin gvfs-fuse ifuse libimobiledevice-utils usbmuxd dnsmasq && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

COPY start.sh start.sh
COPY nginx.conf /etc/nginx/nginx.conf

# This will copy all files in our root to the working  directory in the container
COPY . /usr/share/nginx/html/

#COPY iphoneconnect /lib/udev/iphoneconnect
#RUN chmod 755 /lib/udev/iphoneconnect
#COPY 90-iphone-tether.rules /lib/udev/rules.d/90-iphone-tether.rules
COPY 39-usbmuxd.rules /lib/udev/rules.d/39-usbmuxd.rules
COPY dnsmasq.conf /etc/dnsmasq.conf

# Enable systemd init system in container
ENV INITSYSTEM on

CMD ["bash", "start.sh"]

and node/dockerfile.template

FROM tobi312/rpi-nginx

RUN apt-get update && \
    apt-get install telnet nano iputils-ping less kmod nano net-tools ifupdown i2c-tools libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential libssl-dev g++ samba avahi-daemon avahi-discover wget curl cups printer-driver-gutenprint usbutils gphoto2=2.5.11-1 imagemagick && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# node install
RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
RUN apt-get install -y nodejs

RUN useradd pi && \
    echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
    chmod 0440 /etc/sudoers.d/user && \
    echo "pi:raspberry"|chpasswd && \
    usermod -a -G lpadmin pi

# RUN wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh && chmod +x gphoto2-updater.sh && sudo ./gphoto2-updater.sh --development

# Defines our working directory in container
WORKDIR /usr/src/app

# Copies the package.json first for better cache on later pushes
COPY ./package.json package.json

COPY start.sh start.sh
COPY ./cupsd.conf /etc/cups/cupsd.conf
COPY ./printers.conf /etc/cups/printers.conf


# This install npm dependencies on the resin.io build server,
# making sure to clean up the artifacts it creates in order to reduce the image size.
RUN npm install pm2 -g --no-optional
RUN JOBS=MAX npm install --production --unsafe-perm && rm -rf /tmp/*

# This will copy all files in our root to the working  directory in the container
COPY . ./

# Enable systemd init system in container
ENV INITSYSTEM on

CMD ["bash", "start.sh"]

Please note that both containers are failing so it must be related to the tobi312/rpi-nginx image specifically.
I also posted the issue on github:

and find a similar closed issue that seems related:

thanks

I think the maintainer of tobi312/rpi-nginx on Dockerhub has fixed the issue. Before their fix, I was running some tests with balena push <ipAddress> on a Raspberry Pi with the tobi312/rpi-nginx image, and I was getting errors like "/bin/sleep: cannot execute binary file" – as if /bin/sleep had been compiled for another architecture than ARM. After their fix, that problem went away and I was also able to push a trivial Dockerfile to the balenaCloud builders with success:

FROM tobi312/rpi-nginx
CMD while : ; do echo tobi312/rpi-nginx; sleep 5; done

yep, thanks @pdcastro for testing.
I was able to compile correctly so it looks like it was fixed.
Many thanks

thanks for the feedback! Let us know if you run into any other issues!