-
Notifications
You must be signed in to change notification settings - Fork 383
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] Fix running docker container with existing volume #3540
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whisperity
added
the
package-Docker 🐳
Issues related to the officially supplied Docker images
label
Dec 8, 2021
whisperity
reviewed
Dec 8, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I'm not sure whether we should print these to the standard error, though.
csordasmarton
force-pushed
the
fix_docker_entry_point
branch
from
December 8, 2021 10:31
8ff3666
to
9ff8234
Compare
whisperity
reviewed
Dec 8, 2021
whisperity
reviewed
Dec 8, 2021
- Print some useful info message in the `entrypoint.sh` script file. - If the `workspace` directory already exists when the container started, try to run the given command with the owner of the workspace directory, otherwise run it with the `codechecker` user.
csordasmarton
force-pushed
the
fix_docker_entry_point
branch
from
December 8, 2021 11:27
9ff8234
to
202f72d
Compare
whisperity
reviewed
Dec 8, 2021
Comment on lines
+16
to
+17
echo "Executing script with workspace directory owner (UID): '${workspace_dir_owner}'..." | ||
exec gosu $workspace_dir_owner "$0" "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, can confirm this works!
$ docker run -v $(readlink -f workspace):/workspace codechecker-web:csordasmarton/fix_docker_entry_point
Container started with 'root' user.
Workspace directory '/workspace' already exists.
Executing script with workspace directory owner (UID): '1000'...
Executing command: 'CodeChecker server --workspace /workspace --not-host-only'.
[INFO 2021-12-08 11:25] - Checking configuration database ...
$ pwd; ls -alh
/home/whisperity/CodeChecker/web/docker/workspace
Permissions Size User Date Modified Name
.rw-r--r-- 57k whisperity 8 Dec 12:25 config.sqlite
.rw-r--r-- 209k whisperity 8 Dec 12:25 Default.sqlite
.r-------- 71 whisperity 8 Dec 12:25 root.user
.rw-r--r-- 1,6k whisperity 8 Dec 12:25 server_config.json
whisperity
approved these changes
Dec 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
entrypoint.sh
script file.workspace
directory already exists when the container started, tryto run the given command with the owner of the workspace directory, otherwise
run it with the
codechecker
user.