Merge pull request #11 from kendokan/master

fixed failure if docker group already existed
This commit is contained in:
will Farrell 2018-01-11 09:15:18 -07:00 committed by GitHub
commit f601ca262d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,11 @@ CRONTAB_FILE=/etc/crontabs/docker
mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects
# Create docker group using correct gid from host, and add docker user to it
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCK})
addgroup -g ${DOCKER_GID} docker
adduser docker docker
if ! grep -q "^docker:" /etc/group; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCK})
addgroup -g ${DOCKER_GID} docker
adduser docker docker
fi
slugify() {
echo "$@" | iconv -t ascii | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z