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
'deploy: replicas:' behaving differently after update to 2.3.0.5 #7770
Comments
Thanks for the report, I'm moving this into the compose bug tracker. |
FWIW this new behavior where |
It seems like some other keys in ---
version: "3.8"
services:
whoami:
image: traefik/whoami
deploy:
mode: replicated
replicas: 4
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 5
window: 120s When I spin up the service with docker-compose 1.27.4 I get the following output: $ docker-compose up
WARNING: The following deploy sub-keys are not supported and have been ignored: restart_policy.delay, restart_policy.window
Starting ..._whoami_1 ... done
Starting ..._whoami_2 ... done
Starting ..._whoami_3 ... done
Starting ..._whoami_4 ... done
Attaching to ..._whoami_1, ..._whoami_2, ..._whoami_3, ..._whoami_4
..._whoami_4 | Starting up on port 80
..._whoami_3 | Starting up on port 80
..._whoami_2 | Starting up on port 80
..._whoami_1 | Starting up on port 80 So, four replicas have been started, but it also tells me that ---
version: "3.8"
services:
whoami:
image: traefik/whoami
deploy:
mode: replicated
replicas: 4
restart_policy:
condition: any
delay: 10s
max_attempts: 5
window: 120s I changed $ docker-compose up
WARNING: The following deploy sub-keys are not supported and have been ignored: restart_policy.delay, restart_policy.window
Recreating ..._whoami_1 ... error
Recreating ..._whoami_2 ... error
Recreating ..._whoami_3 ... error
Recreating ..._whoami_4 ... error
ERROR: for ..._whoami_4 Cannot create container for service whoami: maximum retry count cannot be used with restart policy 'always'
ERROR: for ..._whoami_1 Cannot create container for service whoami: maximum retry count cannot be used with restart policy 'always'
ERROR: for ..._whoami_3 Cannot create container for service whoami: maximum retry count cannot be used with restart policy 'always'
ERROR: for ..._whoami_2 Cannot create container for service whoami: maximum retry count cannot be used with restart policy 'always'
ERROR: for whoami Cannot create container for service whoami: maximum retry count cannot be used with restart policy 'always'
ERROR: Encountered errors while bringing up the project. It seems that this key is also read by compose and interpreted as restart policy 'always' |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry for digging out an older issue, but I found the same behaviour. From my point of view, I actually would like to use the replicas setting with docker-compose up, but it still contradicts the documentation, so I'm not confident that this would be future-proof. Can I rely on this behaviour, or might it be that docker-compose up will ignore the replicas settings with the next bugfix release, to be consistent with the documentation? In the former case, the documentation should be adapted. |
This issue has been automatically marked as not stale anymore due to the recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
Expected behavior
When starting web service using docker-compose up, version '3', 'deploy: replicas: 2' should be ignored - https://docs.docker.com/compose/compose-file/#deploy
Actual behavior
Since the setting is set to 2, a second web server is started during docker-compose up. Causing an error due to the port being allocated to web_1. Setting the value to 'deploy: replicas: 1' fixes the issue.
Information
Immediately after updating to 2.3.0.5 I started experiencing an error using 'docker-compose up' on my local machine:
After running 'docker-compose down', I looked for anything using ports 8080 or 9999 and nothing came up.
Original setting:
After some tinkering, I changed replicas to 1 from 2 which fixed the error:
From looking at the documentation, it seems that the deploy setting should be ignored when using 'docker-compose up' (https://docs.docker.com/compose/compose-file/#deploy). The 2.3.0.5 update seems to no longer ignore this setting.
Diagnostic logs
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: