Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
78dd375e
Commit
78dd375e
authored
1 year ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Performance update for the docker entrypoint script
parent
82cd384e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker-entrypoint.sh
+65
-27
65 additions, 27 deletions
docker-entrypoint.sh
with
65 additions
and
27 deletions
docker-entrypoint.sh
+
65
−
27
View file @
78dd375e
...
...
@@ -6,50 +6,88 @@ NO_COLOR="\033[0m"
CHECK_MARK
=
"
\x
E2
\x
9C
\x
93"
CROSS_MARK
=
"
\x
E2
\x
9D
\x
8C"
echo
-n
"Set container UID and GIDs to match the host system..."
if
[[
"
${
NOPAQUE_UID
}
"
==
0
]]
;
then
if
[[
"
${
NOPAQUE_UID
}
"
==
"0"
]]
;
then
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
echo
"Running as root is not allowed"
exit
1
else
echo
""
fi
echo
-n
"- Updating docker GID (
$(
getent group docker |
cut
-d
:
-f3
)
->
${
DOCKER_GID
}
)... "
groupmod
--gid
"
${
DOCKER_GID
}
"
docker
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
echo
-n
"- Updating nopaque GID (
$(
id
-g
nopaque
)
->
${
NOPAQUE_GID
}
)... "
groupmod
--gid
"
${
NOPAQUE_GID
}
"
nopaque
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
"Set container UID and GIDs to match the host system..."
##############################################################################
# docker GID #
##############################################################################
if
[[
"
${
DOCKER_GID
}
"
==
"
$(
getent group docker |
cut
-d
:
-f3
)
"
]]
;
then
echo
-n
"- docker GID is already matching..."
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
echo
-n
"- Updating docker GID (
$(
getent group docker |
cut
-d
:
-f3
)
->
${
DOCKER_GID
}
)... "
groupmod
--gid
"
${
DOCKER_GID
}
"
docker
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
fi
echo
-n
"- Updating nopaque UID (
$(
id
-u
nopaque
)
->
${
NOPAQUE_UID
}
)... "
usermod
--uid
"
${
NOPAQUE_UID
}
"
nopaque
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
##############################################################################
# nopaque GID #
##############################################################################
if
[[
"
${
NOPAQUE_GID
}
"
==
"
$(
id
-g
nopaque
)
"
]]
;
then
echo
-n
"- nopaque GID is already matching..."
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
echo
-n
"- Updating nopaque GID (
$(
id
-g
nopaque
)
->
${
NOPAQUE_GID
}
)... "
groupmod
--gid
"
${
NOPAQUE_GID
}
"
nopaque
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
HAS_NOPAQUE_GID_CHANGED
=
true
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
echo
-n
"- Updating nopaque directory group... "
chown
-R
:nopaque /home/nopaque
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
fi
echo
-n
"- Updating nopaque directory owner and group... "
chown
-R
nopaque:nopaque /home/nopaque
if
[[
"
${
?
}
"
==
"0"
]]
;
then
##############################################################################
# nopaque UID #
##############################################################################
if
[[
"
${
NOPAQUE_UID
}
"
==
"
$(
id
-u
nopaque
)
"
]]
;
then
echo
-n
"- nopaque UID is already matching..."
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
echo
-n
"- Updating nopaque UID (
$(
id
-u
nopaque
)
->
${
NOPAQUE_UID
}
)... "
usermod
--uid
"
${
NOPAQUE_UID
}
"
nopaque
>
/dev/null
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
echo
-n
"- Updating nopaque directory owner... "
chown
-R
nopaque /home/nopaque
if
[[
"
${
?
}
"
==
"0"
]]
;
then
echo
-e
"
${
GREEN_COLOR
}${
CHECK_MARK
}${
NO_COLOR
}
"
else
echo
-e
"
${
RED_COLOR
}${
CROSS_MARK
}${
NO_COLOR
}
"
exit
1
fi
fi
exec
gosu nopaque ./boot.sh
${
@
}
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