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

Added Docker Config Volume #1891

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Genei180
Copy link
Contributor

Summary

There were three Possible Choices to Implement a Mount for a Config File in Docker:

  1. docker run -v:
    You could specify a Volume at the Start of a Container, but it has the Problem that the Folder on the Container, gets overwritten by the Host. So the Config File would have needed to be Included Explicitly. Additional, it would have needed to be separated from the Other files, because they would have been deleted otherwise in the Process of mounting.

  2. Docker Volume:
    Instead of creating it at runtime, it could be created beforehand, which would solve the Above Issue and would Allow for Sharing of Files from the Container with the Host. But this would complicate the Setup needed even further. Therefore, three was chosen.

  3. Dockerfile Volume:
    As the focalboard Database already gets its own Volume Created in the Dockerfile to persist, I added a Volume Creation for the Config File as well in the Dockerfile. This requires less Setup, while still allowing for Easy Access of the Config File.

The Config File Source on the Host System can be found via the following Command:
docker inspect *Container Name* | grep -B 1 "/opt/focalboard" | grep "Source"
Be Aware that with a WSL 2 Docker Setup under Windows, the Folder Location differs from the one displayed.

(Note: The Container needs to be Restarted for the Updates to take Place)

Ticket Link

Provides Solution too #1889

@Genei180 Genei180 requested a review from a team as a code owner November 29, 2021 22:36
@Genei180 Genei180 requested review from hahmadia and chenilim and removed request for a team November 29, 2021 22:36
@mattermod
Copy link
Contributor

Hello @Genei180,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@hahmadia hahmadia requested review from harshilsharma63 and jespino and removed request for hahmadia and chenilim November 29, 2021 22:50
Copy link
Contributor

@jespino jespino left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @Genei180! 🎉

@mattermod
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @BenLloydPearson @aspleenic

@Genei180
Copy link
Contributor Author

Genei180 commented Dec 14, 2021

I am currently Working on a Update, to make it Possible to Include the Config via the -v Option.

The Config.json needs to be moved into its own Directory for that, in my Understanding.

@Genei180
Copy link
Contributor Author

Genei180 commented Jan 30, 2022

Well as is it turns out the Problem i was trying to avoid cant be solved with the Current State of Docker.
I was trying to somehow provide a config.json file in the Bind Mound on the first Run for the User to easily edit.

It would have been Possible if some sort of Shell would be Installed in the Container, that would have allowed copying of the Config File into the Mounted Folder on Runtime.
But because the Container is Distroless this is not easily Possible.

Instead, a Pre-written Config File now needs to be Copied into the Mounted Folder.

Nonetheless Option 1), this should now allow for easy and persisting Configuration that is Compatible with Docker Compose, not like the Previous Option 3) Chosen.

@Genei180 Genei180 requested a review from jespino January 30, 2022 16:15
@Genei180
Copy link
Contributor Author

What's Up with the sudo chown -R nobody /home/user/focalboard-data in the Merge Conflict?

What Purpose does it have?
Additionally, it's an Linux only Command?
Should this maybe be Split up into Multiple Instructions for Certain Operating Systems?

@wjjjjyourFA
Copy link

Hi,it seems that I can't use "volumes: - /path/config:/config" in docker-compose file.

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

Successfully merging this pull request may close these issues.

4 participants