mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-12 01:10:24 +02:00
Fix issue where container name issue
Fix issue where docker swarm names are incorrectly generated when project option is set.
This commit is contained in:
parent
017ee7bfc5
commit
a160036ba2
@ -49,7 +49,7 @@ cat << EOF > ${HOME_DIR}/projects/${SCRIPT_NAME}.sh
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
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
|
for CONTAINER_NAME in \$CONTAINERS; do
|
||||||
docker exec ${DOCKERARGS} \${CONTAINER_NAME} ${TMP_COMMAND}
|
docker exec ${DOCKERARGS} \${CONTAINER_NAME} ${TMP_COMMAND}
|
||||||
done
|
done
|
||||||
@ -213,4 +213,4 @@ if [ "$1" = "crond" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$@"
|
echo "$@"
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user