Repository navigation
Adds container.user configuration - #1109
Conversation
|
Thanks for the contribution! We'll take a look at this soon. For the future, we'd recommend commenting on the issue thread with the design/solution you will be implementing before starting work to help save time potentially changing large portions of the implementation. |
|
Ok I understand. It was very easy to implement. |
|
We can definitely work with most of this :) It's mostly that we need to decide what we would support for the user configuration. Currently, as proposed in #1029 (comment), we are intending only to support user id and group id and not username, but we might decide to allow username as well. @GoogleContainerTools/java-tools |
|
Yeah, looks like we can work on this. There are a few things to think about though. And thinking about it for a while, it might be possible to accept any string as the parameter value, not just numbers, if what we end up doing is to just set the value in the container config metadata. In that case, we may always be able to build an image (need to check), which may error at runtime due to non-existing username. |
Never mind. I think it is always buildable. Now I think there is no problem supporting usernames and it is the user's responsibility to use the base image that has the right user database. Same for usual Docker build. |
|
If we set the wrong username, we have this error at runtime : |
Yeah, it's the same story for |
| } | ||
|
|
||
| /** | ||
| * Sets the username or UID which the process in the container should run as. |
There was a problem hiding this comment.
I believe this can be a mix of user and group.
There was a problem hiding this comment.
You're right, I changed the javadoc.
| * LABEL [key1]="[value1]" \ | ||
| * [key2]="[value2]" \ | ||
| * [...] | ||
| * USER [user or UID] |
| /** | ||
| * Sets the username or UID which the process in the container should run as. | ||
| * | ||
| * @param user the username or UID |
| /** | ||
| * Sets the username or UID which the process in the container should run as. | ||
| * | ||
| * @param user the username or UID. |
3216c1a to
dadc2f5
Compare
coollog
left a comment
There was a problem hiding this comment.
Looks great! Just some comment nits.
| } | ||
|
|
||
| /** | ||
| * Sets the user name (or UID) and optionally the user group (or GID) which the process in the |
There was a problem hiding this comment.
Wording suggestion: Sets the user and group to run the container as. {@code user} can be a username or UID along with an optional groupname or GID. The following are all valid: {@code user}, {@code uid}, {@code user:group}, {@code uid:gid}, {@code uid:group}, {@code user:gid}.
| } | ||
|
|
||
| /** | ||
| * Sets the user name (or UID) and optionally the user group (or GID) which the process in the |
There was a problem hiding this comment.
Wording suggestion: Sets the user for the {@code USER} directive.
| } | ||
|
|
||
| /** | ||
| * Sets the user name (or UID) and optionally the user group (or GID) which the process in the |
There was a problem hiding this comment.
Wording suggestion: Sets the user/group to run the container as.
| * Sets the user name (or UID) and optionally the user group (or GID) which the process in the | ||
| * container should run as. | ||
| * | ||
| * @param user the username and optionally the user group |
There was a problem hiding this comment.
the username/UID and optionally the groupname/GID
| * Sets the user name (or UID) and optionally the user group (or GID) which the process in the | ||
| * container should run as. | ||
| * | ||
| * @param user the username and optionally the user group |
There was a problem hiding this comment.
the username/UID and optionally the groupname/GID
|
Looks good to me. Updating some wordings, and I think we're good to go. |
dadc2f5 to
0082168
Compare
|
Great. I've rebased on master and fixed wordings. |
Towards #1029, this PR adds the possibility to sets the username or UID which the process in the container should run as.
For security reason, we prefer to start a tomcat container with non-root user. We have a generic base image with this (in our private registry) :