-
Notifications
You must be signed in to change notification settings - Fork 244
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 using remote Dockerfiles (HTTP(S) only) for building images #5976
Allow using remote Dockerfiles (HTTP(S) only) for building images #5976
Conversation
…Dockerfile For now, this only supports HTTP(S) and downloads the remote file to a temporary file. The path to that temp. file is then returned to the caller. In all other cases, the specified URI path is returned as is. This means that non-HTTP(S) URIs will *not* get resolved, but will be returned as is. Signed-off-by: Armel Soro <asoro@redhat.com>
…images` commands Signed-off-by: Armel Soro <asoro@redhat.com>
… is relative It actually does not make sense to join absolute Dockerfile paths, as can be the case with temporary files created by downloading a remote Dockerfile Signed-off-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Armel Soro <asoro@redhat.com>
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
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.
/approve
Requested few small items. LGTM otherwise.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dharmit The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…olve a Dockerfile
…`build-images` commands Signed-off-by: Armel Soro <asoro@redhat.com>
pkg/devfile/image/image.go
Outdated
@@ -89,7 +90,7 @@ func buildPushImage(backend Backend, image *devfile.ImageComponent, devfilePath | |||
// selectBackend selects the container backend to use for building and pushing images | |||
// It will detect podman and docker CLIs (in this order), | |||
// or return an error if none are present locally | |||
func selectBackend() (Backend, error) { | |||
func selectBackend(fs filesystem.Filesystem) (Backend, error) { |
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.
Don't find this change comfortable. Actually selectBackend
has no need for the fs
. It's doing something else along with trying to figure out the backend to use, and hence it now needs this extra param.
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.
Makes sense. Instead, I moved this parameter to the Build
method in the image.Backend
interface. This is where it is actually needed, when trying to build the image.
See 878285b
(#5976)
/lgtm |
…`build-images` commands
Kudos, SonarCloud Quality Gate passed!
|
/lgtm |
…dhat-developer#5976) * Add utility function in `docker_compatible.go` allowing to resolve a Dockerfile For now, this only supports HTTP(S) and downloads the remote file to a temporary file. The path to that temp. file is then returned to the caller. In all other cases, the specified URI path is returned as is. This means that non-HTTP(S) URIs will *not* get resolved, but will be returned as is. Signed-off-by: Armel Soro <asoro@redhat.com> * Allow using remote HTTP(S) Dockerfiles with both `deploy` and `build-images` commands Signed-off-by: Armel Soro <asoro@redhat.com> * Join resolved Dockerfile path with the Devfile one only if the former is relative It actually does not make sense to join absolute Dockerfile paths, as can be the case with temporary files created by downloading a remote Dockerfile Signed-off-by: Armel Soro <asoro@redhat.com> * Add integration test cases for `odo build-images` Signed-off-by: Armel Soro <asoro@redhat.com> * Add integration test cases for `odo deploy` Signed-off-by: Armel Soro <asoro@redhat.com> * Update doc for both `build-images` and `deploy` commands Signed-off-by: Armel Soro <asoro@redhat.com> * fixup! Add utility function in `docker_compatible.go` allowing to resolve a Dockerfile * fixup! Allow using remote HTTP(S) Dockerfiles with both `deploy` and `build-images` commands Signed-off-by: Armel Soro <asoro@redhat.com> * fixup! Allow using remote HTTP(S) Dockerfiles with both `deploy` and `build-images` commands * fixup! 878285b
What type of PR is this:
/kind feature
What does this PR do / why we need it:
This PR adds support for remote Dockerfiles (specified via an HTTP or HTTPS URL) when running
odo build-images
orodo deploy
.Which issue(s) this PR fixes:
Fixes #5450
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
See the reproduction steps provided in #5450 for functional testing.
From the code perspective, commits in this branch are atomic and self-contained. This PR can be reviewed on a commit-by-commit basis.