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

Update setup.sh to match docker-compose.yml #36

Merged
merged 2 commits into from
Sep 9, 2023
Merged

Conversation

Pavlogal
Copy link
Contributor

@Pavlogal Pavlogal commented Sep 6, 2023

setup.sh and docker-compose.yml use mismatched config folders.

docker-compose.yml is set up to use /data/config to configs and persistent volumes for containers while setup.sh creates /data/docker for that purpose. Docker will simply auto-create the missing /config when run or the first time but it will still work*, while the entire /docker folder structure will be left empty and useless.

The caveat is that necessary permissions won't be applied when autocreating the /config folder. setup.sh usually takes care of this but since docker isn't using that folder it's going to run with autocreated permissions, owned by root. This is not a problem on its own but there are use cases when this breaks. On NFS filesystems without no_root_squash, the root user is basically useless, so if this script is installed on an NFS share (which is very common in virtualized environments), the containers will fail due to permission issues.

This is easily solvable by modifying either docker-compose.yml to use /docker instead of /config, or modifying setup.sh to use /config instead of /docker, which is the solution I proposed here, for no reason other than /config being a much nicer and more representative name for whats stored inside, plus it's often used in guides.

edit: I realized container_configs.py also needed to be edited, which is taken care of in my 2nd commit

setup.sh and docker-compose.yml use mismatched config folders.

docker-compose.yml is set up to use /data/config to configs and persistent volumes for containers while setup.sh creates /data/docker for that purpose. Docker will simply auto-create the missing /config when run or the first time but it will still work*, while the entire /docker folder structure will be left empty and useless.

The caveat is that necessary permissions won't be applied when autocreating the /config folder. setup.sh usually takes care of this but since docker isn't using that folder it's going to run with autocreated permissions, owned by root. This is not a problem on its own but there are use cases when this breaks. 
On NFS filesystems without no_root_squash, the root user is basically useless, so if this script is installed on an NFS share (which is very common in virtualized environments), the containers will fail due to permission issues.

This is easily solvable by modifying either docker-compose.yml to use /docker instead of /config, or modifying setup.sh to use /config instead of /docker, which is the solution I proposed here, for no reason other than /config being a much nicer and more representative name for whats stored inside, plus it's often used in guides.
@Luctia Luctia self-requested a review September 9, 2023 19:39
Copy link
Owner

@Luctia Luctia left a comment

Choose a reason for hiding this comment

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

Good catch! Looks good to me, thanks for the work.

@Luctia Luctia merged commit 51fb2ae into Luctia:main Sep 9, 2023
1 check passed
@Pavlogal Pavlogal deleted the patch-1 branch April 27, 2024 12:38
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.

2 participants