Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash '-' vs. underscore '_' after project name in container naming #62

Open
csandor opened this issue Sep 12, 2023 · 0 comments
Open

Dash '-' vs. underscore '_' after project name in container naming #62

csandor opened this issue Sep 12, 2023 · 0 comments

Comments

@csandor
Copy link

csandor commented Sep 12, 2023

Great work thanks!

When I start a container with the v1.xx version of docker-compose:

docker-compose up -d <service>

the resulting container name will be: <project_name>_<service>_1

Job runs great.

When i use the go version or a v2.xx version:

docker compose up -d <service>

the resulting container name will be: <project_name>-<service>-1

See dash vs. underscore in container name.

I think docker-crontab might have the underscore (_) burnt in somewhere and tries to find the container to run the script in using that separator (/opt/crontab/projects/*.sh):

CONTAINERS=$(docker ps --format '{{.Names}}' | grep -E "^<project_name>_<container_name>.[0-9]+")

And the job won't run as would not find a running container.

docker-compose version 1.29.2, build unknown
Docker Compose version v2.15.1
Docker version 24.0.5, build ced0996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant