Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embltilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Renato Alves
embltilities
Commits
2d5656b4
Verified
Commit
2d5656b4
authored
7 years ago
by
Renato Alves
Browse files
Options
Downloads
Patches
Plain Diff
ENH docker_wrap now supports multiple shells if available
parent
5602ac3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/docker_wrap.sh
+9
-1
9 additions, 1 deletion
bin/docker_wrap.sh
with
9 additions
and
1 deletion
bin/docker_wrap.sh
+
9
−
1
View file @
2d5656b4
...
...
@@ -18,6 +18,14 @@ setup_user() {
NEWUID
=
"
$(
stat
-c
'%u'
"
$TARGET
"
)
"
NEWGID
=
"
$(
stat
-c
'%g'
"
$TARGET
"
)
"
if
[
-f
"/bin/zsh"
]
;
then
USE_SHELL
=
"/bin/zsh"
elif
[
-f
"/bin/bash"
]
;
then
USE_SHELL
=
"/bin/bash"
else
USE_SHELL
=
"/bin/sh"
fi
echo
">>> checking for group
$NEWGID
"
if
!
getent group
"
$NEWGID
"
>
/dev/null 2>/dev/null
;
then
busybox addgroup
-g
"
$NEWGID
"
"
$NEWUSER
"
||
(
echo
"!!! Couldn't create group with id
$NEWGID
"
&&
exit
1
)
...
...
@@ -28,7 +36,7 @@ setup_user() {
fi
echo
">>> checking for user
$NEWUID
"
if
!
getent passwd
"
$NEWUID
"
>
/dev/null 2>/dev/null
;
then
busybox adduser
-G
"
$NEWGROUP
"
-u
"
$NEWUID
"
-h
"
$TARGET
"
-s
/bin/sh
-D
"
$NEWUSER
"
||
(
echo
"!!! Couldn't create user"
&&
exit
1
)
busybox adduser
-G
"
$NEWGROUP
"
-u
"
$NEWUID
"
-h
"
$TARGET
"
-s
"
$USE_SHELL
"
-D
"
$NEWUSER
"
||
(
echo
"!!! Couldn't create user"
&&
exit
1
)
echo
">>> created user
$NEWUSER
(
$NEWUID
)"
else
NEWUSER
=
"
$(
getent passwd
"
$NEWUID
"
|
cut
-d
:
-f1
)
"
...
...
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