-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
New command: build
to build images using minikube
#11164
Conversation
Currently only handles tarballs, not directories
Will create a temporary tarball, if given a dir Some code from github.com/fsouza/go-dockerclient (but not exported as a library, for some reason) Upgrade docker client and cherry-pick windows From v18.09.0 to v19.03.15, plus c3a0a37446 Update go-dockerclient and remove internal deps
Use the long name also for examples and usage
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.
since this is a new feature @afbjorklund would you please add an integration test ? maybe in FunctionalTest Next To docker-env test?
that way it could serve as both Example of using and also we will ensure we never break it
It seems that there were no tests for any of the previous |
a267c60
to
541acb6
Compare
541acb6
to
2d02aba
Compare
/ok-to-test |
2d02aba
to
93c40d1
Compare
timing minikube failed, please try again |
Obviously I only looked for |
timing minikube failed, please try again |
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.
windows integration test failing
2021-04-23T16:06:32.9069971Z === CONT TestFunctional/parallel/BuildImage
2021-04-23T16:06:32.9074954Z functional_test.go:291: (dbg) Non-zero exit: ./minikube-windows-amd64.exe ssh -p functional-20210423160039-16840 -- docker image inspect my-image: exit status 1 (1.591562s)
2021-04-23T16:06:32.9093489Z
2021-04-23T16:06:32.9095921Z -- stdout --
2021-04-23T16:06:32.9103442Z []
2021-04-23T16:06:32.9105356Z Error: No such image: my-image
2021-04-23T16:06:32.9106462Z
2021-04-23T16:06:32.9110386Z -- /stdout --
2021-04-23T16:06:32.9112516Z ** stderr **
2021-04-23T16:06:32.9116138Z ssh: Process exited with status 1
2021-04-23T16:06:32.9122414Z
2021-04-23T16:06:32.9124982Z ** /stderr **
2021-04-23T16:06:32.9131411Z functional_test.go:329: listing images: exit status 1
2021-04-23T16:06:32.9133450Z
2021-04-23T16:06:32.9138610Z -- stdout --
2021-04-23T16:06:32.9142331Z []
2021-04-23T16:06:32.9146494Z Error: No such image: my-image
2021-04-23T16:06:32.9149756Z
2021-04-23T16:06:32.9160974Z -- /stdout --
2021-04-23T16:06:32.9165037Z ** stderr **
2021-04-23T16:06:32.9166630Z ssh: Process exited with status 1
2021-04-23T16:06:32.9168890Z
2021-04-23T16:06:32.9172849Z ** /stderr **
2021-04-23T16:06:32.9177731Z helpers_test.go:218: -----------------------post-mortem--------------------------------
@@ -21,7 +21,7 @@ require ( | |||
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 | |||
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect | |||
github.com/docker/cli v0.0.0-20200303162255-7d407207c304 // indirect | |||
github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible |
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.
is there a PR upstream that we could comment here to remove the replace after the PR gets merged ?
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 had to backport a build fix, since the older Docker 19.03 doesn't build with the newer Windows versions.
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.
Alternatively one could upgrade everything to the Docker 20.10 API, but that is much more intrusive and big
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.
The patch was: moby/moby@c3a0a37
The integration test is failing with containerd/buildkitd it seems, due to the naming of the image:
We need to build "localhost/my-image:latest", then it would be fully qualifed and not get Docker Hub:ed
It would also work with crio/podman, that will prepend this "localhost" prefix to all unqualified images...
|
return tmp, nil | ||
} | ||
|
||
func downloadRemote(cr CommandRunner, src string) (string, 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.
add unit test for this ? or maybe break down the logic of detecting remote and add unit tests, so we know exactly what user would input
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.
Right, but then we need to start a web server or something to host the files to build (the ones in testdata/build) ?
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 think the detection part of the (the scheme detection) could be put in a separate func with unit test ?
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.
We only implement it for buildkit, both docker and podman have their own (internal) implementation...
It's related to the DOS paths from the host:
The code needs to be more careful about which paths are from the host (possibly weird), and which are on machine (and sane) |
And add some cleanup and improved logging as well
kvm2 driver with docker runtime
Times for minikube ingress: 35.9s 34.8s 36.8s 36.3s 35.7s Times for minikube start: 52.8s 52.9s 51.8s 51.1s 47.7s docker driver with docker runtime
Times for minikube start: 23.8s 21.4s 21.5s 22.0s 21.2s Times for minikube ingress: 31.5s 33.0s 32.5s 34.5s 36.5s docker driver with containerd runtime |
So need to be on the lookout for "C:\\path"
Using file: scheme means build local context
It hides the docker.io and the "library" parts
kvm2 driver with docker runtime |
kvm2 driver with docker runtime
Times for minikube ingress: 42.8s 43.3s 44.3s 43.7s 36.9s Times for minikube start: 56.1s 47.0s 47.8s 47.7s 46.7s docker driver with docker runtime
Times for minikube ingress: 32.0s 32.5s 33.5s 32.0s 37.5s Times for minikube start: 22.8s 21.9s 22.4s 22.6s 21.3s docker driver with containerd runtime |
kvm2 driver with docker runtime
Times for minikube start: 49.3s 47.2s 48.2s 48.0s 51.4s Times for minikube ingress: 42.9s 34.8s 43.3s 41.9s 34.3s docker driver with docker runtime
Times for minikube start: 21.9s 22.4s 21.7s 22.0s 21.0s Times for minikube ingress: 36.5s 33.0s 37.0s 34.5s 37.0s docker driver with containerd runtime |
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.
Looks good to me @ , Thank you for this feature. I am excited to see how our users will use this
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afbjorklund, medyagh 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 |
build
to build images using minikube
This is a rebase of PR #10742
Closes #4868