sovrin-foundation/old-sovrin

Enhance Docker file

Opened this issue · 5 comments

a-fox commented

As started in the Sovring forum (http://forum.sovrin.org/t/docker-build-of-latest-codebase-doesnt-work/41), the Dockerfile needs to be enhanced. Some thoughts in how to make it better:

  • optimized base image
  • use separate image for orientdb daemon
  • use Docker compose (for linking images)
  • minimize need of scripts & run them from separate file

Please add requirements in comments (@dhh1128 & anybody else) on what things are must (Linux distro, specific library versions, etc.). I probably won't have time to do too much testing & failing to find the correct libraries, so this would help me quite a bit.

For the time being, I recommend we start from a ubuntu 14.04 image as the base, because that is the most tested path. However, I believe using a debian image as the base would give us a cleaner and smaller image in the long run, so I'd like to explore switching at some point. See https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/ for more details about this point, as well as some recommendations about the use of RUN in the Dockerfile, etc.

Older versions of libraries have not been tested extensively--that's another reason to start from ubuntu 14 for the time being. Perhaps we could dump a list of the libraries used in the latest docker image, and use that list of libraries to document a "minimum required version" for each. No doubt some older versions would also work, so we could move the minimum versions backward in some cases as we get greater experience.

BTW, I modified the docker files slightly today, including some renaming and some internal reorg. I also build a new version of sovrinfoundation/sovrin:latest and pushed to dockerhub. A few of the desirable changes, such as reducing the number of layers, were completed.

Please, have a look at https://github.com/bacen/sovrin.

The Dockerfile is quite clean and has fewer layers. The image itself can be tested with:

docker run --net=host -ti bacen/sovrin sovrin

I think that Java8 and OrientDB, if/when needed, should be in another container. If the "all-in-one" approach is desirable, even then I would put them in a derived image (keep the slim one as a choice).

Thank you, @andrefernandes ! Very nice.

Can you submit a pull request that places your file in the sovrin-foundation/sovrin repo at docker-files/Dockerfile-client? We can then publish this image as sovrinfoundation/sovrin-client on dockerhub, and rename the other image to sovrinfoundation/sovrin-all. Does that seem like a good approach?