-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Allow Passing in Context as io.ReadCloser #110
Comments
@gianarb @mdelapenya what do you guys think of this one? |
I like the idea @ClaytonNorthey92 and I think it is a well-known interface in Go, let's do it as you suggested! Can you also write a set of examples for both scenarios? |
Hey @gianarb thanks! Yes I will make sure I include both documentation and tests for both scenarios (by |
ClaytonNorthey92
pushed a commit
to ClaytonNorthey92/testcontainers-go
that referenced
this issue
Nov 14, 2019
resolves testcontainers#110 Added a ContextArchive attribute to the FromDockerfile struct, this allows a user to pass in an io.Reader as the Docker build context. A user will now be allowed to create a dynamic build in code and send it to the build. Added test cases for both scenarios (using a local filepath and an archive). Added example to README.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
As of now, when we allow a user to build and image from a Dockerfile, we only allow them to pass in the build context as a string, which is meant to be the path to the build context on their filesystem. Then we archive that directory before we send it to the Docker API, so it becomes a type that implements ReadCloser
I would like to allow the ability to use a ReadCloser as the context in
FromDockerfile
. This would allow consumers of our API to dynamically set files within the archive before sending it to the Docker API, and would be less implicit than what we do now. However, I would like to also keep our current functionality because I like the abstraction.To Reproduce
Not a bug. No reproduction steps.
Expected behavior
I am not sure what we want the API to look like, maybe:
if the consumer sets both
Context
andContextArchive
we could return an error, specifying that you should only choose one or the other.Additional context
this conversation started this idea
The text was updated successfully, but these errors were encountered: