Skip to content

Commit

Permalink
✨(project) add bin/compose shortcut
Browse files Browse the repository at this point in the history
When using raw docker-compose commands, the UID and GID environment
variables are supposed to be defined. Hence, to avoid having a warning
message (and potential errors), one should use the following command:

UID=$(id -u) GID=$(id -g) docker-compose

To ease our life, we've added a bin/compose script that can be used as a
shortcut for a configured docker-compose command.
  • Loading branch information
jmaupetit committed Sep 4, 2019
1 parent 46946fa commit eaebdc3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bin/compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Only define UID & GID variables if they are not. Note that we cannot rely on
# bash variable substitution default value as, when defined, the UID and GID
# variables are read-only variables.
if [[ -z ${UID} ]]; then
UID=$(id -u)
fi

if [[ -z ${GID} ]]; then
GID=$(id -g)
fi

export UID
export GID

docker-compose "${@}"

0 comments on commit eaebdc3

Please sign in to comment.