-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Support Docker rootless mode & fix file ownership in root mode #771
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
90fa1b9
feat: add bindfs to support linux users. Fixes #594 (#769)
drmikecrowe 072239a
Optional BindFS mapping of file owners; allow install in rootless mode
Nuru ff6ead5
shfmt
Nuru 718d335
Remove recommendations to run scripts under `sudo`
Nuru 1f744e9
Add documentation
Nuru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
busybox-extras | ||
diffutils | ||
drill | ||
fuse | ||
fzf-bash-completion | ||
iputils | ||
keybase-client@testing | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Essential debian-only packages | ||
bindfs | ||
default-mysql-client | ||
dnsutils | ||
inetutils-ftp | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
|
||
IMPORTANT: | ||
* Unless there were errors reported above, | ||
* your host $HOME directory should be mounted to `/localhost`, and | ||
* your host AWS configuration and credentials should be available. | ||
* Use Leapp on your host computer to manage your credentials. | ||
* Leapp is free, open source, and available from https://leapp.cloud | ||
* Use AWS_PROFILE environment variable to manage your AWS IAM role. | ||
* You can interactively select AWS profiles via the `assume-role` command. | ||
# Unless there were errors reported above, | ||
# * Your host $HOME directory should be available under `/localhost` | ||
# * Your host AWS configuration and credentials should be available | ||
# * Use Leapp on your host computer to manage your credentials | ||
# * Leapp is free, open source, and available from https://leapp.cloud | ||
# * Use AWS_PROFILE environment variable to manage your AWS IAM role | ||
# * You can interactively select AWS profiles via the `assume-role` command | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Files in the profile.d directory are executed by the lexicographical order of their file names. | ||
# This file is named _20-localhost.sh. The leading underscore is needed to ensure this file executes before | ||
# other files that depend on the file system mapping defined here. | ||
# The number portion is to ensure proper ordering among the high-priority scripts. | ||
# This file has only depends on colors.sh and should come before any scripts that | ||
# attempt to access files on the host via `/localhost`. | ||
|
||
if [[ $SHLVL == 1 ]] && [[ -n $GEODESIC_HOST_UID ]] && [[ -n $GEODESIC_HOST_GID ]] && | ||
[[ -n $GEODESIC_LOCALHOST ]] && df -a | grep -q " ${GEODESIC_LOCALHOST}\$"; then | ||
if [[ $(df -a | grep ' /localhost$' | cut -f1 -d' ') == ${GEODESIC_LOCALHOST} ]]; then | ||
echo "# Host file ownership mapping already configured" | ||
export GEODESIC_LOCALHOST_MAPPED_DEVICE="${GEODESIC_LOCALHOST}" | ||
elif df -a | grep -q ' /localhost$'; then | ||
red "# Host filesystems found mounted at both /localhost and /localhost.bindfs." | ||
red "# * Verify that content under /localhost is what you expect." | ||
red "# * Report the issue at https://github.com/cloudposse/geodesic/issues" | ||
red "# * Include the output of \`env | grep GEODESIC\` and \`df -a\` in your issue description." | ||
elif bindfs -o nonempty ${GEODESIC_BINDFS_OPTIONS} --create-for-user="$GEODESIC_HOST_UID" --create-for-group="$GEODESIC_HOST_GID" "${GEODESIC_LOCALHOST}" /localhost; then | ||
green "# BindFS mapping of ${GEODESIC_LOCALHOST} to /localhost enabled." | ||
green "# Files created under /localhost will have UID:GID ${GEODESIC_HOST_UID}:${GEODESIC_HOST_GID} on host." | ||
export GEODESIC_LOCALHOST_MAPPED_DEVICE="${GEODESIC_LOCALHOST}" | ||
else | ||
red "# ERROR: Unable to mirror /localhost.bindfs to /localhost" | ||
red "# * Report the issue at https://github.com/cloudposse/geodesic/issues" | ||
red "# * Work around the issue by unsetting shell environment variable GEODESIC_HOST_BINDFS_ENABLED." | ||
red "# * Exiting." | ||
exec false | ||
fi | ||
fi |
8 changes: 5 additions & 3 deletions
8
rootfs/etc/profile.d/_geodesic-config.sh → rootfs/etc/profile.d/_30-geodesic-config.sh
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
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
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
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
Oops, something went wrong.
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.
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.