-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
feat: add image-keep option for built images #1785
feat: add image-keep option for built images #1785
Conversation
Adds an option to keep images if they have been built. This avoids the need to build these images everytime from scratch.
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I added a few comments that need to be addressed. But other than that, this LGTM.
Once resolved I think we can merge this one, thanks for your contribution!
@lefinal I'm planning a release hopefully this week, so I took this PR and fixed the lint for you (running Regarding my comments regarding coding style, are you interested in updating the PR with them? I can do it myself on top of your commits in order to have this PR in the new release |
I made the requested changes. Do you want me to squash them so that we have a clean history? Or are the 5 commits okay. Don't know if you generate any changelogs from them. |
Thanks for doing it! No worries, we always squash the PRs when merging them into main. Will trigger the CI (it will pass, I ran your tests locally and they pass) and merge the PR. |
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.
LGTM! Thanks for taking the time to contribute this feature.
What does this PR do?
Adds an option to keep images if they have been built.
This avoids the need to build these images every time from scratch.
Built images are being kept in
DockerContainer.Terminate
whenKeepImage
is set totrue
inContainerRequest
.Why is it important?
If images for testing are built with long build time, they are currently always deleted.
This means that for each test run, the whole image needs to be rebuilt.
If the image stays the same for every test, this may take up a lot of time.
Related issues
FromDockerfile
builds to allow multiple containers using the same image #1485How to test this PR
Create a container with image-build manually and set
KeepImage
to true.Tests for this functionality have been added as well.