mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-04 14:05:11 +02:00
Merge pull request #4 from jamesfielder/master
Fix issue where container name is incorrectly generated when using docker swarm
This commit is contained in:
commit
d83f0b3a1b
@ -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 "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user