-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Ubuntu 24.04, bump some versions of dependencies, and use some of the packages from Ubuntu instead of building OpenCV manually. There is also an ubuntu user/group by default in the base image, so use that instead of creating a separate docker user like before. Refs #3
- Loading branch information
Showing
1 changed file
with
16 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using an
ubuntu
user and user group will lead to the need to overhaul existing setups.For example, on our server users have docker privileges only when they belong to a docker group. In order to run force in a container from this image, a new image group will need to be created, assuming
ubuntu
group does not exist already, which could lead to potential conflicts.My suggestion is to keep the user and user group as
docker
. It would allow for a seamless transition.e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker user/group in the Ubuntu 20.04 image had uid/gid 1000. It will have uid/gid 1001 in Ubuntu 24.04, since the ubuntu user/group already has uid/gid 1000.
Most Linux users have a single-user system, so their local user has uid/gid 1000, and they can write files from inside docker into their local home directory seamlessly. If the user inside the container suddenly has uid/gid 1001 it's going to cause permission problems. (Users who don't have uid/gid 1000 has that problem already, but those usrs are much more rare.) Docker Desktop on MacOS has some kind of built-in support for mapping uid/gid between the host and container, so that doesn't show this problem.
Gitlab runs docker-in-docker because CI jobs frequently build docker images. I can't see why you would run docker inside a Force image though, can you describe the use-case you have for running docker inside docker?
e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not use a docker inside the docker.
I built the base image using the spec above and then try to build force with this updated image: https://github.com/davidfrantz/force/pull/336/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557.
It crushes on
building FORCE
. I had a bit more luck when I changed user and user group to docker. Still, I was not able to run force in the container. We do not spin force containers as root users.e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is normal. Otherwise you are not allowed to run Docker. The group within the container is unrelated to this. It just serves the purpose that the container cannot be called as root.
e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the image built based on this Dockerfile is missing
libgdal.*
in /lib/. I see the libgdal-dev is listed in line 35, but only the following libraries are available in /lib/the base image based on ubuntu20.04 has the following libs:
Not sure whether because of this or due to additional issues, I am not able to build force based on this image.
Do you have any thoughts on how to resolve it? Thanks in advance!
e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packages suffixed with
-dev
contain things required for compilation, such as header files (*.h
, etc.) and static libraries (*.a
).The x86-64 GDAL libraries reside under
/usr/lib/x86_64-linux-gnu
in the Ubuntu 24 package: https://packages.ubuntu.com/noble/amd64/libgdal34t64/filelistIf you want to build force on the Ubuntu 24.04-based image, I suggest you use the patches in davidfrantz/force#336. That PR builds, but it still needs to be tested, so use at your own risk.
e863dfb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear @pjonsson. Thank you for coming back to me. I am doing exactly as you have suggested. I first build the base image as specified above (e863dfb), and then try to build the force image (3.8.0) from davidfrantz/force#336 on top of it. Sadly, the force fails to build. Therefore, I compared the libraries in the image base image based on the 20.04 version and the one above looking for the differences that could be a reason for the failing build.
Of course, you are correct,
libgdal.*
are in the/usr/lib/x86_64-linux-gnu
.I guess, I should move then my inquiry to the davidfrantz/force#336. I see the pull passes all the checks, yet for some reason, the force image does not build successfully (exit error 2) on my system.