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

provider/docker: add option to keep local image on destroy #6376

Merged

Conversation

xsellier
Copy link

Working with many docker container, I need to keep some local images even if I want to destroy the container, I want to keep the image locally. So I added the option keep_locally.

- Add option keep_locally
- Add unit test
- Add documentation
@stack72
Copy link
Contributor

stack72 commented Apr 27, 2016

This LGTM! Tests are green and i can see that the docker image exists after the tests run

TF_LOG=1 make testacc TEST=./builtin/providers/docker TESTARGS='-run=TestAccDockerImage' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/docker -v -run=TestAccDockerImage -timeout 120m
=== RUN   TestAccDockerImage_basic
--- PASS: TestAccDockerImage_basic (42.22s)
=== RUN   TestAccDockerImage_private
--- PASS: TestAccDockerImage_private (167.67s)
=== RUN   TestAccDockerImage_destroy
--- PASS: TestAccDockerImage_destroy (85.13s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/docker 295.044s

terraform [xsellier-feature/docker-keep-image-on-destroy●] % docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
crux                3.1                 7e0975b8569c        6 months ago        341.7 MB

@stack72 stack72 merged commit e4a1d21 into hashicorp:master Apr 27, 2016
xsellier pushed a commit to xsellier/terraform that referenced this pull request May 17, 2016
- Add option keep_locally
- Add unit test
- Add documentation
@xsellier xsellier deleted the feature/docker-keep-image-on-destroy branch January 9, 2017 14:59
@ghost
Copy link

ghost commented Apr 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
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.

2 participants