Docker ARM Builds

Hi Team,

I was reviewing today if it is possible to create ARM builds for the Osimis Docker containers. The good news is that I can build an ARM64 container using the --platform linux/arm64 option.

However it looks like the Osimis Web Viewer & Stone Viewer are being built by Jenkins and downloaded into the container.

My questions are:

  1. Is there interest in me submitting patches to allow building ARM versions of the Osimis Orthanc container?
  2. If so, we would need to build the matching binaries for the Osimis Web Viewer & Stone viewer. Is it best to modify the Jenkins build to create both binaries or is it better to include the build in the ARM64 Dockerfile?
    Cheers,

James

Hi James,

  1. Feel free to share the patches for ARM64 and I’ll try to integrate them. I’ve never built a Docker image for ARM 64 so I can not guarantee that we will publish them regularly but that would already be nice if people are able to build them by themselves.
  2. I think it’s better to include the build instructions in the Dockerfile themselves. Both viewers have quite complex build procedures, that’s the reason why I have never integrated their build in the Dockerfile.
    However, it makes perfect sense for the StoneViewer.
    The Osimis Viewer is even more complex to build and, since it is deprecated, I would just “forget” it for ARM64 arch.

Best regards,

Alain

Hello James,

As far as the “Stone Web viewer” is concerned, we have a BuildBot server (not Jenkins) that builds the static resources (WebAssembly + HTML + CSS). Those static resources are continuously published in the “wasm-binaries.zip” file at the following location:
https://lsb.orthanc-server.com/stone-webviewer/mainline/

These static resources are platform-independant, because they are executed client-side by the Web browser. They are thus fully compatible with ARM.

The Orthanc plugin for the Stone Web viewer is then built from the following CMake project:
https://hg.orthanc-server.com/orthanc-stone/file/default/Applications/StoneWebViewer/Plugin

The CMake option “ORTHANC_STONE_BINARIES” of this project allows to indicate where the “wasm-binaries.zip” has been uncompressed.

You could thus create an ARM image by downloading the “wasm-binaries.zip”, then building only the plugin from sources (which is a very small project).

HTH,
Sébastien-

Hi Alain,

With Docker, it is possible to build multi-architectures with the same build command. I can provide an example script that demonstrates this.

Thanks Sébastien, I can use that to update the Dockerfile to also build the Stone viewer.

It will take me a while but I’ll get back when I’ve got something to contribute.

Cheers,

James

Hi Alain,

Please find attached a patch for the Orthanc Builder repo that updates docker/orthanc/Dockerfile to allow ARM builds as discussed. For non amd64 builds, I remove the OsimisWebViewer plugin. This patch also includes a minor refactor to allow configuration of the version numbers at the top of the Dockerfile. This is purely a suggestion, personal preference of mine.

I have also attached a script that can be used to build and publish multi-architecture containers in 1 go. I used this script to publish linux/amd64 & linux/arm64 builds of Orthanc to here https://hub.docker.com/repository/docker/jamesmanners/orthanc. You can use this as a basis for publishing multi-architecture builds to Docker Hub if you wish.

I have been testing the ARM build on my development machine and it is working well. My plan is to start testing the ARM build in our staging environment as well.

Hope this helps.

Cheers,

James

multi-platoform-build.sh (642 Bytes)

patch.diff (3.67 KB)

Hi James,

Thanks, I’ve updated our Dockerfile.

I’ve tried building the ARM64 on our build slaves but could not make it through so I finally disabled it. Anyone should still be able to build locally anyway.

Best regards,

Alain.