Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Fixing rm command and API…#130

Merged
vdemeester merged 1 commit into
docker-archive-public:masterfrom
vdemeester:129-fix-rm-command
Jan 18, 2016
Merged

Fixing rm command and API…#130
vdemeester merged 1 commit into
docker-archive-public:masterfrom
vdemeester:129-fix-rm-command

Conversation

@vdemeester
Copy link
Copy Markdown
Contributor

… to behave more like docker-compose. Fixes #129 🐝.

$ libcompose-cli ps
# […]
Name           Command                         State         Ports
compose_db_1   /docker-entrypoint.sh postgres  Up 8 seconds  5432/tcp
compose_web_1  nginx -g 'daemon off;'          Up 8 seconds  443/tcp, 80/tcp
$ libcompose-cli rm
# […]                      
No stopped containers
$ libcompose-cli stop db
# […]
$ libcompose-cli rm
# […]
Going to remove compose_web_1, compose_db_1
Are you sure? [yN]

As docker-compose it will try to remove only containers that are stopped. And the --force flag is used to skip the confirmation only 🐞.

$ libcompose-cli stop db
# […]
$ libcompose-cli rm --force
# […]                  
Going to remove compose_db_1
$ libcompose-cli ps
# […]
Name           Command                 State          Ports
compose_web_1  nginx -g 'daemon off;'  Up 54 seconds  443/tcp, 80/tcp

It's not really done yet :

  • Probably should add some log/information of each container removed (like docker-compose does). This should be handled widely on the cli I think.
  • Should add more integration tests (making sure we don't remove non-stopped containers, etc…).

🐸

Signed-off-by: Vincent Demeester vincent@sbr.pm

@vdemeester
Copy link
Copy Markdown
Contributor Author

/ping @dnephin @ibuildthecloud

Comment thread docker/container.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want Force: true. We're already checking if it's stopped, so we shouldn't need to force it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you're right 😝.

… to behave more like docker-compose.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@vdemeester
Copy link
Copy Markdown
Contributor Author

@dnephin Updated, rebased and added an integration tests.

@dnephin
Copy link
Copy Markdown
Contributor

dnephin commented Jan 18, 2016

LGTM

vdemeester added a commit that referenced this pull request Jan 18, 2016
@vdemeester vdemeester merged commit 0e83b2f into docker-archive-public:master Jan 18, 2016
@vdemeester vdemeester deleted the 129-fix-rm-command branch January 18, 2016 22:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants