haugene / docker-transmission-openvpn

Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
GNU General Public License v3.0
4.09k stars 1.2k forks source link

Build .armhf image on raspberry pi #638

Closed steveman1982 closed 5 years ago

steveman1982 commented 5 years ago

Luckily :latest-armhf works for me. But before stumbling upon that solution I tried to build the image, which resulted in this:

docker build -t transmission-openvpn -f Dockerfile.armhf . Sending build context to Docker daemon 51.68MB Step 1/13 : FROM resin/rpi-raspbian:stretch ---> 21dc8fc1377f Step 2/13 : MAINTAINER Kristian Haugene ---> Running in db295b976b88 Removing intermediate container db295b976b88 ---> 96ba3f58f537 Step 3/13 : RUN [ "cross-build-start" ] ---> Running in 9be13a5e398d standard_init_linux.go:190: exec user process caused "exec format error" The command 'cross-build-start' returned a non-zero code: 1

Tried this on master and v2.4.

dutch1e commented 5 years ago

I appear to be having the same issue with :latest-armhf on a Nanopi K2 running armbian. Docker pulls the image fine and creates the container, however the container is continually restarting with error 132, and no text in the container logs.

Output from the following commands here > https://pastebin.com/K7nveEcJ docker ps -a uname -a cat /proc/cpuinfo

dutch1e commented 5 years ago

Output of build from dockerfile: docker build https://raw.githubusercontent.com/haugene/docker-transmission-openvpn/master/Dockerfile.armhf Sending build context to Docker daemon 6.656kBs://raw.githubusercontent.com/haugene/docker-transmission-openvpn/master/Dockerfile.armhf 5.085kB Step 1/13 : FROM resin/rpi-raspbian:stretch ---> 21dc8fc1377f Step 2/13 : MAINTAINER Kristian Haugene ---> Running in 4afb53f40808 Removing intermediate container 4afb53f40808 ---> cf4e6269b3b9 Step 3/13 : RUN [ "cross-build-start" ] ---> Running in c0d1700e63a7 standard_init_linux.go:190: exec user process caused "exec format error" The command 'cross-build-start' returned a non-zero code: 1

haugene commented 5 years ago

These armhf images are purely contributed from the community and I have not worked with them before. But the ability to build the image on docker hub came with this commit https://github.com/haugene/docker-transmission-openvpn/commit/5ab2fe9daeb0d67238dbafc679f488921f59b614 and it would not surprise me that this cross-platform build fix could cause trouble when not building cross-platform (ie, you're building on armhf).

Have you tried removing cross-build-start, and cross-build-end? The PR referenced this article: https://www.balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/

So you could try to go more in depth on what these commands to and how they behave on armhf.

steveman1982 commented 5 years ago

Cool, with those lines removed the images build for me on raspbian :)

dutch1e commented 5 years ago

Removed those references from the following: ./Dockerfile.armhf ./plugins/rss/Dockerfile.armhf ./proxy/Dockerfile.armhf

Now have an error during build at Step 5/11: docker build - < Dockerfile.armhf Sending build context to Docker daemon 6.656kB Step 1/11 : FROM resin/rpi-raspbian:stretch ---> 21dc8fc1377f Step 2/11 : MAINTAINER Kristian Haugene ---> Using cache ---> 494ac01be1eb Step 3/11 : VOLUME /data ---> Running in 8c35dc1cee70 Removing intermediate container 8c35dc1cee70 ---> d7418fdbf531 Step 4/11 : VOLUME /config ---> Running in 9d1f4ee9033b Removing intermediate container 9d1f4ee9033b ---> 53a6af2a0a6e Step 5/11 : RUN apt-get update && apt-get -y install transmission-cli transmission-common transmission-daemon && apt-get install -y dumb-init unzip openvpn curl ufw git tinyproxy jq && curl -L -o /tmp/release.zip https://github.com/Secretmapper/combustion/archive/release.zip && unzip /tmp/release.zip -d /opt/transmission-ui/ && rm /tmp/release.zip && git clone git://github.com/endor/kettu.git /opt/transmission-ui/kettu && mkdir /opt/transmission-ui/transmission-web-control && curl -L https://github.com/ronggang/twc-release/raw/master/src.tar.gz | tar -C /opt/transmission-ui/transmission-web-control/ -xzv && apt-get purge git unzip && apt-get autoremove --purge && apt-get clean && rm -rf /var/lib/apt/lists/ /tmp/ /var/tmp/ && curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.0/dockerize-linux-armhf-v0.6.0.tar.gz | tar -C /usr/local/bin -xzv && groupmod -g 1000 users && useradd -u 911 -U -d /config -s /bin/false abc && usermod -G users abc ---> Running in b4c80190ddcb The command '/bin/sh -c apt-get update && apt-get -y install transmission-cli transmission-common transmission-daemon && apt-get install -y dumb-init unzip openvpn curl ufw git tinyproxy jq && curl -L -o /tmp/release.zip https://github.com/Secretmapper/combustion/archive/release.zip && unzip /tmp/release.zip -d /opt/transmission-ui/ && rm /tmp/release.zip && git clone git://github.com/endor/kettu.git /opt/transmission-ui/kettu && mkdir /opt/transmission-ui/transmission-web-control && curl -L https://github.com/ronggang/twc-release/raw/master/src.tar.gz | tar -C /opt/transmission-ui/transmission-web-control/ -xzv && apt-get purge git unzip && apt-get autoremove --purge && apt-get clean && rm -rf /var/lib/apt/lists/ /tmp/ /var/tmp/ && curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.0/dockerize-linux-armhf-v0.6.0.tar.gz | tar -C /usr/local/bin -xzv && groupmod -g 1000 users && useradd -u 911 -U -d /config -s /bin/false abc && usermod -G users abc' returned a non-zero code: 132

Not sure where to go next - maybe an issue with arm32 support on my cpu. I might need to update to use an arm64 base image.

AdrienKuhn commented 5 years ago

It's possible the cross-build doesn't work on an ARM architecture.

Maybe we can create a new Dockerfile to keep automatic ARM builds on DockerHub and remove the cross-build commands from the Dockerfile.armhf file.

Miesvanderlippe commented 5 years ago

@AdrienKuhn Has this fix been merged into 'dev-armhf' or 'latest-armhf' yet? I'm still getting the error on those release tags.

AdrienKuhn commented 5 years ago

@Miesvanderlippe the fix has been merged into dev and master.