Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
8fbaaca5
Commit
8fbaaca5
authored
7 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[util][docker] Fix issue with user id in set permission script
(cherry picked from commit
44a8cc96
)
parent
b23944e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/moduleutil/createdockerimage.sh
+8
-7
8 additions, 7 deletions
bin/moduleutil/createdockerimage.sh
with
8 additions
and
7 deletions
bin/moduleutil/createdockerimage.sh
+
8
−
7
View file @
8fbaaca5
...
...
@@ -71,14 +71,15 @@ cp ../.dockerignore .
touch
setpermissions.sh
cat
<<
EOT
>> setpermissions.sh
#!/bin/bash
# The user can pass the user id (UID) by passing --env HOST_UID=
$UID
# The user can pass the user and group id by passing
# --env HOST_UID=
\$
(id -u
\$
USER) --env HOST_GID=
\$
(id -g
\$
USER)
# with the UID on the host to the container. Should work for Linux, Mac and Windows.
# Allows to manage the writes for shared volumes.
if [ "
$HOST_UID
" ]; then
usermod -u
$HOST_UID
dumux
if [ "
\
$
HOST_UID" ]; then
usermod -u
\
$
HOST_UID dumux
fi
if [ "
$HOST_GID
" ]; then
groupmod -g
$HOST_GID
dumux
if [ "
\
$
HOST_GID" ]; then
groupmod -g
\
$
HOST_GID dumux
fi
# Make sure that everything in /dumux is accessible by the dumux user
# sed "1d" removes forst line which is the folder itself
...
...
@@ -184,8 +185,8 @@ open()
{
IMAGE="
\$
1"
COMMAND="docker create -ti
\\
-e HOST_UID=
\$
UID
\\
-e HOST_GID=
\$
GID
\\
-e HOST_UID=
\$
(id -u
\$
USER)
\\
-e HOST_GID=
\$
(id -g
\$
USER)
\\
-v
\$
SHARED_DIR_HOST:
\$
SHARED_DIR_CONTAINER
\\
--name dumuxpub_
$DOCKER_TAG
\\
\$
IMAGE /bin/bash"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment