vscode-docker
vscode-docker copied to clipboard
Add option to remove volume _and_ container that's using it
Repro steps:
- Using Vscode & Docker on Windows
- Start a docker-compose stack with shared local volume
- rename the volume in your docker-compose.yml
- "docker-compose up -d" => the new named volume is created and showing up
- trying to delete the old volume wont work even after restarting vscode & docker completely
Action: vscode-docker.volumes.remove Error type: 409 Error Message: (HTTP code 409) conflict - remove stack1_data: volume is in use - [718bb945308234da47e349XXXXXXXXXXXXXXX21ae78b944e3eeb4edcc4c72b3a]
Version: 0.7.0 OS: win32 Product: Visual Studio Code Product Version: 1.37.0 Language: en
Call Stack
extension.bundle.js:157:579404extension.bundle.js:157:579404
extension.bundle.js:157:579367extension.bundle.js:157:579367
module.exports.m.buildPayload extension.bundle.js:157:579377
IncomingMessage.<anonymous> extension.bundle.js:157:578877
IncomingMessage.emit events.js:187:15
endReadableNT _stream_readable.js:1092:12
process._tickCallback next_tick.js:63:19
Did you try stopping the container before deleting it?
Yes, the containers were all stopped. Even restarted Docker to make sure.
@Hexxonite based on this thread seems like stopping a container isn't enough. You have to remove them as well. You can do that in one of several ways as mentioned in that thread:
- Manually remove the container if you know which one it is
- Prune containers to remove all stopped containers
- docker compose down
In any case, we could probably figure out which container is using the volume and give users an option to remove that first. Modified title to reflect that