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

Docker permissions issue #56

Closed
aaronleopold opened this issue Sep 25, 2022 · 5 comments
Closed

Docker permissions issue #56

aaronleopold opened this issue Sep 25, 2022 · 5 comments
Labels
bug Something isn't working docker

Comments

@aaronleopold
Copy link
Collaborator

aaronleopold commented Sep 25, 2022

Docker seems to create stump's config directory, on the host machine, with root privilege, making root the owner. This becomes a big problem during runtime, as stump won't have permissions to modify/access the config folder, which causes a ton of errors.

Changing the permissions manually fixes this, but this is really not ideal.

I have only been able to reproduce this issue on Linux (both a dedicated install, as well as WSL). Config folder must not already be present (~/.stump), otherwise issue won't occur.

@aaronleopold aaronleopold added bug Something isn't working docker hacktoberfest labels Sep 25, 2022
@oliviacarino
Copy link

Hey! Just to clear things up, the goal is to give stump only the permissions to the config directory and not create it within the host machine?

Can I take on this issue?

@aaronleopold
Copy link
Collaborator Author

aaronleopold commented Sep 26, 2022

Hi! So to clarify, when the config folder (e.g. ~/.stump) does not exist on the host machine, Docker creates it with the root user as the owner. So if I had this compose file:

version: '3.3'
services:
  stump:
    image: aaronleopold/stump-preview
    ports:
      - '10801:10801'
    user: '1000:1000'
    volumes:
      - /Users/aaronleopold/Documents/Stump:/data
      - /Users/aaronleopold/.stump:/config

When I run docker compose up, docker creates /Users/aaronleopold/.stump with root and Stump internally throws a bunch of permissions errors, e.g. cannot create database or cannot create log file, etc. So the goal is to figure out how to get docker to create that config folder on the host machine not owned by root. Does that make sense?

If you still would like it, feel free to take it on! Keep in mind, if it is for hacktoberfest don't make the PR until it actually starts. Otherwise, I am not sure it will be counted towards your total.

For the quickest debugging, use a variation of pnpm build:docker-amd and not build:docker. The arm images take a long time 😄

@oliviacarino
Copy link

That makes sense, thank you :) I will still take it on!

@tuxuser
Copy link
Contributor

tuxuser commented Feb 24, 2023

That docker's standard behaviour and is not really fixable afaik.

The alternative would be to use a docker volume instead of a host-path-binding. Would that be an acceptable solution?

Update:

When trying to do the bind-mount, docker-compose actually errors out and won't let the user startup the container

# docker-compose up
Creating network "22_default" with the default driver
Creating stump ... error

ERROR: for stump  Cannot start service stump: Bind mount failed: '/volume2/docker/portainer/compose/22/config' does not exists

ERROR: for stump  Cannot start service stump: Bind mount failed: '/volume2/docker/portainer/compose/22/config' does not exists
ERROR: Encountered errors while bringing up the project.
# docker -v
Docker version 20.10.3, build 55f0773
# docker-compose -v
docker-compose version 1.28.5, build 24fb474e

tuxuser added a commit to tuxuser/stump that referenced this issue Feb 25, 2023
aaronleopold added a commit that referenced this issue Feb 25, 2023
…les (#89)

* docker: Allowing to downgrade to regular user via environment variables (fixed issue #56)

* docker: Use full relative path to entrypoint.sh

Relative path as seen from repo-root

Co-authored-by: Aaron Leopold <36278431+aaronleopold@users.noreply.github.com>

---------

Co-authored-by: Aaron Leopold <36278431+aaronleopold@users.noreply.github.com>
@aaronleopold
Copy link
Collaborator Author

Resolved from #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker
Projects
None yet
Development

No branches or pull requests

3 participants