-
Notifications
You must be signed in to change notification settings - Fork 299
feat: implement devcontainer stop and down commands #1041
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
base: main
Are you sure you want to change the base?
feat: implement devcontainer stop and down commands #1041
Conversation
- Add 'devcontainer stop' command to stop running containers - Add 'devcontainer down' command to stop and remove containers - Support --all flag to target all devcontainers - Support --workspace-folder to target specific workspace - Support --id-label for custom label filtering - Support --remove-volumes for down command - Update README.md to mark both commands as completed - Handle both single container and Docker Compose configurations
@microsoft-github-policy-service agree |
poke @bamurtaugh :-) |
…ands - List containers before stopping/removing in docker-compose projects - Return actual container IDs in removedContainers/stoppedContainers arrays - Report correct containersFound count for docker-compose configurations - Ensures proper visibility of which containers are affected by operations
Fixed observability for docker-compose projectsThe issue where Changes:
Example output after fix:
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Left a few comments.
- Use proper logging output instead of dropping log messages - Add dockerPath parameter support for Docker/Podman compatibility - Change --all flag to use devcontainer.metadata label for safer filtering - Add error logging for container inspection and volume removal failures - Follow existing codebase patterns for dockerComposeCLI configuration
Sincerest thanks for the thorough review! I've made all the requested changes: ✅ Fixed issues:
|
Description
This PR implements the
devcontainer stop
anddevcontainer down
commands as requested in #386.Changes
devcontainer stop
command to stop running dev containers without removing themdevcontainer down
command to stop and remove dev containers--workspace-folder
to target containers in a specific workspace--all
flag to target all dev containers--id-label
for filtering by custom labels--remove-volumes
flag (down command only) to also remove associated volumesTesting
Tested locally with the devcontainer-cli project itself:
Starting a dev container:
Stopping the container:
Verifying container is stopped but not removed:
Removing the container:
Verifying container is completely removed:
Fixes
Fixes #386