root-project / root-docker

Docker recipes for ROOT
30 stars 33 forks source link

Added Dockerfile for ROOT built from source on Ubuntu #45

Closed lobis closed 2 years ago

lobis commented 2 years ago

This Dockerfile will built root from source on Ubuntu. It implements some of the changes in https://github.com/root-project/root-docker/pull/44 as a separate PR as discussed.

It takes three optional arguments:

UBUNTU_VERSION: Ubuntu version tag (https://hub.docker.com/_/ubuntu), defaults to 20.04. ROOT_VERSION: git tag, branch or commit hash from https://github.com/root-project/root. Defaults to master. CMAKE_CXX_STANDARD: C++ standard used when building root. Defaults to 17.

I also copied the packages file from ubuntu into this new directory, perhaps there is a better way to do this that avoids replicating (and mantaining in sync) these two files.

The ROOT_VERSION takes the root version string as on the git tags, which is not compatible with the current published tags on https://github.com/root-project/root-docker. This means that the CI will have to implement a way to translate between the version strings.

I added only the -Dbuiltin_afterimage=ON to the cmake, however there are possibly some other useful options that can be added to this, feel free to add to this.

eguiraud commented 2 years ago

Thanks! This is useful to produce an Ubuntu image with ROOT built with C++17, which users sometimes ask for.

I also copied the packages file from Ubuntu into this new directory, perhaps there is a better way to do this that avoids replicating (and maintaining in sync) these two files.

We can use a symlink.

The ROOT_VERSION takes the root version string as on the git tags, which is not compatible with the current published tags on https://github.com/root-project/root-docker.

Maybe GIT_REVISION is a better name for the argument (also because e.g. master is not, strictly a "root version")?

This means that the CI will have to implement a way to translate between the version strings.

Probably, the only translation we'll need is between v6-XX-YY and 6.XX.YY, I guess that's ok.

I added only the -Dbuiltin_afterimage=ON to the cmake, however there are possibly some other useful options that can be added to this, feel free to add to this.

@Axel-Naumann @bellenot can you please comment on this?

lobis commented 2 years ago

We can use a symlink.

I have tried to do so on 7039cd3 but it doesn't seem to work since the file is outside the build context, perhaps I am missing something.

eguiraud commented 2 years ago

I have tried to do so on 7039cd3 but it doesn't seem to work since the file is outside the build context, perhaps I am missing something.

oh, COPY doesn't like symlinks, I didn't know! uhm, let's duplicate packages for now then, and if a better solution comes along we can always apply it later.

lobis commented 2 years ago

Thanks @lobis , I was distracted by some other ROOT things the last couple of weeks, but I think this can go in right? Just one remaining comment for your consideration

Yes, I think this is ready to go now.

I updated the base ubuntu version to 22.04 to be on line with the other ubuntu image. I have just tested the build of the image and it worked.

eguiraud commented 2 years ago

Thank you very much! BTW with Ubuntu 22.04, by default ROOT builds with C++17. I'll take a last look and merge after the Easter holidays