-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[BUG] docker compose when parentheses are present in entrypoint or command strings #9965
Comments
I'm sorry - this is probably a duplicate of #8512, which has been closed because of inactivity :/ |
Until we get such corner case better supported by shellwords library (see mattn/go-shellwords#54) you can use quotes: services:
traefik:
image: traefik:v2.9.4
command: "--providers.docker --providers.docker.constraints='Label(pycon.traefik, true)'" |
Escaping with backslashes also works. services:
traefik:
image: traefik:v2.9.4
command: --providers.docker --providers.docker.constraints=Label\(pycon.traefik,\ true\) FWIW, it seems that this behavior is compliant with the POSIX.1-2017 standard specification, where the parentheses are defined as control operators that require quoting. |
Considering control operators are well defined in POSIX (thanks @antichris for the link) and quoting is both recommended and a simple workaround, I'm closing this issue as "not planned" |
Description
The bug effectively disables me from using traefik's
providers.docker.constraints
flag, which requires presence of parentheses in the command/entrypoint string:command: "--providers.docker --providers.docker.constraints=Label(pycon.traefik, true)"
Everytime I try running
docker compose up
, the following decoding error is printed:When I remove parentheses from the command it starts up, but these braces are needed there for Traefik to understand the constraint.
Using
docker compose --compatibility up
doesn't solve the issue.Docker Compose v1 has no issues with decoding the same compose file.
Steps To Reproduce
docker-compose.yml
file with the following contents:docker compose up
(
and)
removes the error, but then Traefik does not understand the syntax.Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: