-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test with -w in docker-entrypoint.sh gives error #72
Comments
What error ? |
|
This error is rather self explanatory: use the |
Setting user to 9001:9001 doesn't change the error. /home/qgis is writable by all users. This is a problem with if [[ ! -w $HOME ]], it returns the wrong exitcode. If I start the image with entrypoint /bin/sh and run the following code I should get exitcode 0, but get 1 (even if I change user to root):
Here is where this was discussed in Alpine: |
Tests with [ -r ] doesn't seem to work either but most other file tests (-e, -f, -d, etc.) works. Could you make an alternative docker-entrypoint.sh without the troublesome -w and -r tests? |
You missed the point: do not set user to 9001:9001 but set it to the actuel uid:gid of your actual binded directory ! Setting directory root will not work: for security reason the image will not start Your problem come from the fact the /home/qgis is not writable by the user that run in the container. You may either:
Do not use root ! |
I havn't binded /home/qgis. Pure image, no mounts. |
I did not try to run the image as root. I was just confirming that the write permission test [ ! -w ] fails even if I'm a superuser (root). |
I don't understand your issue then, the /home/qgis is created at image build with correct uid/gid and has no issue so far. Please give more details about your environment and the command used to run the image. |
As I said, this is only a problem if running on a host with a docker engine older than 20.10.0. I copied your image and removed the problematic tests from docker-entrypoint.sh: With this image I got further, but ended up with another error:
I guess I simply can't run your image on our old hosts anymore (up until 3.30 worked fine). |
Tried the image on a newer host, running docker 23.0.6, and it worked. |
Docker 18 is known te be incompatible with new distros: see https://medium.com/nttlabs/ubuntu-21-10-and-fedora-35-do-not-work-on-docker-20-10-9-1cd439d9921 and HumanSignal/label-studio#3070 (ubuntu 22,04 and bookworm included). You may try to rebuild the image using debian:bullseye as base image instead ubuntu:22.04 or bookworm |
Ok, thanks. |
I've had this problem with some Alpine images before and the fix is to upgrade Docker to version 20(.something) or newer. The files tested are writable, it's the test itself that fails. Images prior to 3.34 worked fine. Our Hosts are running Docker 18.06.3 and can not be upgraded.
The text was updated successfully, but these errors were encountered: