Merge pull request #4 from jamesfielder/master

Fix issue where container name is incorrectly generated when using docker swarm
This commit is contained in:
will Farrell 2017-10-09 11:34:31 -06:00 committed by GitHub
commit d83f0b3a1b

View File

@ -49,7 +49,7 @@ cat << EOF > ${HOME_DIR}/projects/${SCRIPT_NAME}.sh
#!/usr/bin/env bash
set -e
CONTAINERS=\$(docker ps --format '{{.Names}}' | grep -E "^${PROJECT}_${CONTAINER}_[0-9]+")
CONTAINERS=\$(docker ps --format '{{.Names}}' | grep -E "^${PROJECT}_${CONTAINER}.[0-9]+")
for CONTAINER_NAME in \$CONTAINERS; do
docker exec ${DOCKERARGS} \${CONTAINER_NAME} ${TMP_COMMAND}
done
@ -213,4 +213,4 @@ if [ "$1" = "crond" ]; then
fi
echo "$@"
exec "$@"
exec "$@"