Hello Stephan,
A docker multistage build can be used in order to avoid huge image size and useless docker layers (read here how to): For example, Dockerfile:
FROM ubuntu:18.04 as plugins-compiler
Steps:
-- Plugins compiler image
----> install deps, prepare environment
----> compile aws cpp sdk (only s3-transfer)
----> compile orthanc cloud storage aws s3 plugin (how to) -- Final orthanc image
----> copy shared libraries deps from previous image
----> copy aws so from previous image
Inside plugins-compiler you must prepare the environment for the compilation, install required linux packages etc..
After the compilation, you must copy the binaries from image 'plugins-container' to final orthanc docker image.
In order to resolve shared dependencies, as workaround you can copy whole '/usr/local/lib' from 'plugins-compiler':
COPY --from=plugins-compiler /usr/local/lib /usr/local/lib/
AWS plugin '.so' must also pe present, for example:
COPY --from=plugins-compiler /plugins/libOrthancAwsS3Storage.so /usr/share/orthanc/plugins-disabled/libOrthancAwsS3Storage.so
Remarks:
- in my case, vcpkg cryptopp was not enough, so the install command look like : ./vcpkg/vcpkg install cryptopp cpprestsdk boost
- if you run in troubles with shared libraries, you can check the aws compiled '.so' requirements using ldd: ldd /plugins/libOrthancAwsS3Storage.so
- building inside docker is a very good practice because the environment is isolated and the build process can be easily reproduced, also docker builds is caching every layer, so in case of a retry, untouched layers are cached (save time and money :d )
Good luck!
Alex