-
Notifications
You must be signed in to change notification settings - Fork 424
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
Not possible anymore to run as non-root #602
Comments
@MathiasVDA What is the issue, running as root you will need to execute
But by default the container runs as a none-root. If you still need the PR to be restricted you can reopen it and make the adjustments and we can review it |
Openshift will run containers with a random user (which can be simulated with the -u flag in docker run). There is no possibility to define the user as an environmental variable in the docker run command. Openshift will also not allow to run the setup files as root.
Sorry I don't want to interfere in what is really a great opensource project. It was my purpose to try to improve this project but I now realise that not everyone might see my suggestion as an improvement. Which is absolutely fine. I will close this issue and try to find another method to run geoserver on our openshift cluster. |
@MathiasVDA We are not against your suggestions but we need to make sure that when you incorporate them they still also work for a standard installs like vanilla Ubuntu, popOS etc. I think in your previous PR that was closed you could resurrect it but have an if condition in entrypoint that could test the architecture i.e https://github.com/kartoza/docker-geoserver/blob/develop/scripts/setup.sh#L89 We have no much experience with open shift. So rather reopen the old PR, make improvements and we can take it from there in the code review. If you remember the previous PR was closed on the assumption that it was now working. Another alternative would be to figure out how we could publish the images mainly geared for openshift. I am sure there are actions to do this |
@MathiasVDA Any news? Have you found the solution? |
@Rezorl yes, we have created our own dockerfile and startup script based on docker.osgeo.org/geoserver The docker.osgeo.org/geoserver also has issues with running the container as nonroot The dockerfile mainly:
The entrypoint script mainly:
|
@MathiasVDA Thanks. Could you show what the changed/added files look like? |
@Rezorl Sure, here it is: https://gitlab.com/mathias.vanden.auweele/geoserver-openshift |
It works. Thank you. |
Thanks for taking the time to write up this issue @MathiasVDA. I tried upgrading our Kartoza OpenShift deployment a while back and also saw the breaking changes in the entrypoint scripts. You summarized the issues nicely. |
@mdprev @MathiasVDA Coming back to the issue again. It seems like the container runs as root but the tomcat instance runs as the specific user that is defined, According we are using gosu to step down from running tomcat as root with https://github.com/tianon/gosu. How about having the following options:
The main goal here is to have non root containers as it poses security risks |
Feature description
We use geoserver on openshift and that requires to run with a random user id but with group id=0. In general, it's not advised to run containers as root. It used to be the case, after closing this merge request: #195 that your image allowed to run as non-root. However, now there are many mkdir, groupadd, useradd, chown, ... commands executed in the entrypoint scripts that don't allow to run as anything other then root anymore.
Additional context
Run as non root means that you can startup your container with:
docker run -it -e GROUP_NAME=0 -e GEOSERVER_GID=0 -u 12345:0 geoserver-test kartoza/geoserver
The text was updated successfully, but these errors were encountered: