0

I have a Docker File for my application and I use Docker Hub to build it. This works fine on a Synology DS218+ Disk Station, which is Intel based.

Qnap supports Docker on both Intel and Arm devices with its Container Station software , I have purchased a TS131P to test this out but it failed with exec format error. Apparently I have to build an Arm version of the image, but how do I do this ?

Can I build the image on the Qnap itself somehow ?

Update

So my base image was openjdk:8-jre-alpine, so I have found on DockerHub an arm32 equivalent of this, https://hub.docker.com/r/arm32v6/openjdk/ so now:

  • Created a new BitBucket rep
  • Copied over Docker File
  • Changed first line of Docker File to FROM arm32v6/openjdk:8-jre-alpine
  • Created a new Automated Build on Docker linked to this repo

But the build is now failing on the second line

RUN apk --no-cache add \
       curl \
       tini

with

[91mstandard_init_linux.go:190: exec user process caused "exec format error"

Since I am using arm image I assume that apk should be compiled for arm, or do I need to tell Docker Hub to build on Arm rather than Intel ?

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • 1
    I think you will have to change the base image of your `Dockerfile`. [Docker hub](https://hub.docker.com/) has images for arm. When playing with a raspberry pi I had used images from [resin.io](https://hub.docker.com/u/resin/) – tgogos Oct 12 '18 at 07:21
  • 1
    okay I have found an arm32 equivalent of by base image, modified first line to FROM arm32v6/openjdk:8-jre-alpine and trying rebuild in dockerhub – Paul Taylor Oct 12 '18 at 08:52
  • Trouble is after the FROM command I have a RUN cmd (RUN apk --no-cache add curl tini) and on build within DockerHub this is failing with "exec format error". Could it be that although the FROM image is Arm based Docker is trying to build image using Intel and therefore apk comand does'nt work, do I have to tag the architecture in some way. – Paul Taylor Oct 12 '18 at 09:31
  • I don't understand the *"build within DockerHub"* part. Maybe it's something I haven't used. Have you tried to ssh into your device and try to use `docker build ...` inside Qnap? – tgogos Oct 12 '18 at 09:38
  • ok, I just saw the update... – tgogos Oct 12 '18 at 09:39
  • @tgogos i nearly have working, can you see what im missing https://stackoverflow.com/questions/52777216/in-docker-hub-is-it-possible-to-build-an-automated-build-for-an-arm-image – Paul Taylor Oct 13 '18 at 08:52
  • 1
    @tgogos Right have it working now. – Paul Taylor Oct 13 '18 at 13:33

1 Answers1

1

The simple answer is you have to build an arm image on an arm server, so I built in on the Arm nas itself, since this supports Docker, this is what I did

  • Ensure ContainerStation running on nas server
  • ssh nas server (from PC)
  • docker build buildfile docker login
  • --enter username username
  • --enter password password
  • docker images (to get imageId of built image)
  • docker tag imageId repoName/imageName:latest
  • docker push

and this was enough to make arm32 version available to be installed on arm32 machine.

Currently I have two separate images, one for Intel and one for Arm. I understand that there is a way to combine multiple images into a single super image, but I have not attempted that yet. repoName/imageName:latest

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351