-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Dockerfile for a image that can be used in a pod on kubernetes #1972
Conversation
Dockerfile.kubernetes
Outdated
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.
Is there any limitation to have a separate Dockerfile
for k8s?
It would be nice to merge your changes with the PR #1792. What do you think?
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.
No there is no limitation it also works in local docker stack, it's just the additional layers to set the permission via group instead of a specific user, to run as rootless docker container.
I've just created a separate dockerfile because there were already a external
and local
edition
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.
Can you try with last version? This includes GID and UID :)
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.
It's not working on kubernetes. The UID to run the container is assigned by the node running the pod (https://www.redhat.com/en/blog/a-guide-to-openshift-and-uids). There is a kubernetes setting securityContext/runAsUser
, but this feature is disabled on the cluster I'm working for safety concerns
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.
Is it related with openshift kubernetes?
I'm not sure if it's a native kubernetes feature or a Openshift one
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‘ve looked it up. Its just a openshift thing (random UID). Vanilla kubernetes can run the docker container …
Why did you reopened this PR? |
I thought maybe as openshift variant. But if you like to close it, It's okay for me :-D |
Kubernetes assigns a random user id to the pod, so the
chown
to worker in the present Dockerfiles won't be sufficient. In the new docker file the ownership is handeled with a group.I've tested this on a openshift kubernetes cluster.
Hope it can help others.