Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
docker-image-recipes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5604d6da
authored
2017-09-20 10:25:11 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add better file ownership changing.
1 parent
8c5c11c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
node/files/entrypoint
node/files/entrypoint
View file @
5604d6d
...
...
@@ -5,13 +5,18 @@ set -ex
node_home
=
"
$(
getent passwd node | cut -f 6 -d :
)
"
if
[[
$GID
&&
$GID
-ne 0
]]
;
then
old_gid
=
$(
getent group node | cut -f 3 -d :
)
groupmod -g
$GID
node
find
"
$node_home
"
-gid
$old_gid
-print0 | xargs -0r chgrp node
fi
if
[[
$UID
&&
$UID
-ne 0
]]
;
then
usermod -u
$UID
node
fi
find
"
$node_home
"
\
'('
-not -user node -a -not -group node -exec chown node:node
'{}'
+
')'
-o
\
'('
-not -user node -exec chown node
'{}'
+
')'
-o
\
'('
-not -group node -exec chgrp node
'{}'
+
')'
-o
\
-true
if
[[
-e package.json
]]
;
then
sudo -u node npm install
fi
...
...
Please
register
or
sign in
to post a comment