Skip to content

Commit

Permalink
Make sure UID/GID are set correctly
Browse files Browse the repository at this point in the history
* learned that ARG in Dockerfile doesn't accept ENV vars to overwrite
  without the --build-arg, now this is done correctly
  • Loading branch information
JeroenBoersma committed Jul 12, 2017
1 parent f20a4dc commit b1142db
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions bin/dev_command/build
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@

dc yml_all
dc mode build
dc cmd "$*";
services=`main config --services`;

user_id=`id -u`;
group_id=`id -g`;

if [ -n "${user_id}" ]; then
userarg='--build-arg=UID='${user_id};
fi
if [ -n "${group_id}" ]; then
grouparg='--build-arg=GID='${group_id};
fi

dc yml_all;
dc mode build;
dc cmd "${userarg} ${grouparg} $@";

for a in ${services}; do
cmd="`dc show` $a";
${cmd};
done
exit;

0 comments on commit b1142db

Please sign in to comment.