Add withCopyFileToContainer to copy files to containers#62
Merged
alexbiehl merged 1 commit intotestcontainers:masterfrom Jul 31, 2025
Merged
Add withCopyFileToContainer to copy files to containers#62alexbiehl merged 1 commit intotestcontainers:masterfrom
withCopyFileToContainer to copy files to containers#62alexbiehl merged 1 commit intotestcontainers:masterfrom
Conversation
LaurentRDC
commented
Jul 31, 2025
| dockerCreate = | ||
| concat $ | ||
| [["run"]] | ||
| ++ [["--detach"]] |
Collaborator
Author
There was a problem hiding this comment.
Note that the --detach flag isn't supported by docker start, because this is the default behavior
Collaborator
|
If you rebase your changes we should get a working CI again. |
Collaborator
Author
|
I also updated the Changelog, assuming that the next release will be 0.5.2.0 |
Collaborator
Author
|
Thanks for the quick turnaround :) |
Collaborator
Author
|
@alexbiehl Would you be able to create a new release, 0.5.2.0, to deploy this change? Alternatively, I see I'm allowed to upload releases on Hackage, but I'm not allowed to commit to this repo directly. If you prefer, you could give me permission to commit on the master branch (so I can update the cabal file) and I can create a release myself |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new function,
withCopyFileToContainer, which allows to, well, copy files to a container. This is very useful, for example, when initializing a Postgres database.In order to copy files to the container, the
runfunction was modified to usedocker create+docker startrather thandocker run. This allows to get the container ID early (fromdocker create), and thus copy files usingdocker cpbefore callingdocker start.