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

Add setting for "docker-compose --compatibility" #2021

Closed
sburlappp opened this issue May 27, 2020 · 7 comments
Closed

Add setting for "docker-compose --compatibility" #2021

sburlappp opened this issue May 27, 2020 · 7 comments
Labels

Comments

@sburlappp
Copy link

Docker removed the ability to easily define memory and CPU limits on services in v3 Compose files, unless you're also using Swarm. However, they did eventually add the "--compatibility" flag as a work-around:

https://docs.docker.com/compose/compose-file/compose-versioning/#compatibility-mode

This can currently be enabled in VScode by adding these lines to settings.json:

{
    "docker.commands.composeUp": "docker-compose --compatibility ${configurationFile} up ${detached} ${build}",
    "docker.commands.composeDown": "docker-compose --compatibility ${configurationFile} down"
}

Please consider adding an option "docker.dockerComposeCompatibility" which would work like docker.dockerComposeBuild and docker.dockerComposeDetached to add the "--compatibility" option when desired. (Also, please consider having it default to "true".)

@bwateratmsft
Copy link
Contributor

bwateratmsft commented May 27, 2020

Is command customization not sufficient? I don't know that the --compatibility flag is right/necessary for most people; assuming that's the case then user-customizable commands are enough to fill the gap.

@karolz-ms
Copy link
Contributor

I think Docker is working on new iteration of Compose spec that will bring CPU and memory limits back...

@sburlappp
Copy link
Author

The --compatibility flag was added as a compromise for users who wanted to use the v3 file format for local development. Officially, Docker recommends using v2 for local and v3 for Swarm:

docker/compose#4513
docker/compose#5684

It appears that the --compatibility flag is as close as they intend to get to restoring the old functionality. I do plan to leave my own settings.json customized, but expect that many others have run into this issue too. Adding a VScode setting with an explanation in the docs would probably help avoid confusion.

(Or, if this is rejected, leaving this note here may help others anyway.)

@bwateratmsft
Copy link
Contributor

Is a setting specific to compatibility any easier to discover than the generic command customization settings, though?

@karolz-ms do you know where the info about those compose items possibly returning is?

@karolz-ms
Copy link
Contributor

@bwateratmsft the cpu limits etc reintroduction is tracked by this issue

Given this is point-in-time limitation and that a good workaround exists (command customization is a good fit for those who want --compatibility flag) I suggest we don't do anything on VS Code Docker ext side

@bwateratmsft
Copy link
Contributor

Good to know. It seems like there is actual traction on the issue; i.e. there are PRs being created and merged. So, I agree that this seems like a point-in-time problem.

@bwateratmsft
Copy link
Contributor

@sburlappp based on the availability of command customization and the temporary nature of the issue, we have decided not to add this setting. Nevertheless, we do want to thank you for your suggestion, we really appreciate it!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants