Skip to content
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

use the USER directive #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

use the USER directive #187

wants to merge 1 commit into from

Conversation

brunnre8
Copy link
Member

@brunnre8 brunnre8 commented May 1, 2024

We are currently using a custom entrypoint script. However docker has a built in volume / user approach so we can get rid of this custom approach altogether.
The benefit of this is that it just works across the stack and we don't need to teach users to run it with --user node and such. Further, using thelounge as an entrypoint means that you don't need to exec to a running container but can just spawn a throwaway container (probably with --rm) when you want to manage users etc.

This does have some limitations though if people use bind mounts. Docker doesn't have the ability to auto chown things (podman does, with the U option to -v).

So let's suggest named volumes instead (which is better anyways)

Existing users should not be impacted, as the entrypoint script did the permission setup for them already, so even the new container should just continue to work.

People who manually mess with the container will have to use --entrypoint /bin/sh or such, but they shouldn't treat containers like pets, so breaking that is of no concern.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Copy link
Member

@williamboman williamboman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The entrypoint changes may cause some users to run into issues starting the container with a different command, for example:

$ docker run -it ghcr.io/thelounge/thelounge sh

This will now have to be

$ docker run --entrypoint sh ghcr.io/thelounge/thelounge

The release mechanism uses "conventional/semantic" commits to pick up changes for the changelog, so this PR should have a semantic commit message if it is to be included in the changelog. Not sure what the ideal scope would be but I'd suggest using feat: ....

README.md Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@brunnre8
Copy link
Member Author

brunnre8 commented May 2, 2024

The entrypoint changes may cause some users to run into issues starting the container with a different command

Yes, tried to say as much in the commit message. But that's an anti pattern and I don't really think we should cater to those much.

ACK re the convention commit thing, I'll fix that up, sorry, I didn't look at the convention.

We are currently using a custom entrypoint script.
However docker has a built in volume / user approach so we can get
rid of this custom approach altogether.
The benefit of this is that it just works across the stack and we don't
need to teach users to run it with `--user node` and such.
Further, using thelounge as an entrypoint means that you don't need to
exec to a running container but can just spawn a throwaway container
(probably with --rm) when you want to manage users etc.

This does have some limitations though if people use bind mounts.
Docker doesn't have the ability to auto chown things
(podman does, with the U option to -v).

So let's suggest named volumes instead (which is better anyways)

Existing users should not be impacted, as the entrypoint script
did the permission setup for them already, so even the new container
should just continue to work.

People who manually mess with the container will have to use
--entrypoint /bin/sh or such, but they shouldn't treat containers
like pets, so breaking that is of no concern.
@brunnre8
Copy link
Member Author

brunnre8 commented May 3, 2024

addressed all review comments now I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants