Skip to content
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

docker-machine tweaks in support of PR #13 #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dx9
Copy link

@dx9 dx9 commented Sep 24, 2019

Depends on #13

Tested against docker-machine.

sharifelgamal and others added 8 commits September 19, 2019 10:17
Search for boot files using patterns instead of hard coded paths.

Similar to the docker-machine-driver-xhyve approach.

Signed-off-by: John Coyle <dx9err@gmail.com>
Only set CPU or memory values when requested value is greater than the default.

Signed-off-by: John Coyle <dx9err@gmail.com>
Hyperkit uses this UUID to assign a MAC address that the driver is expecting. The driver searches for this MAC address in the DHCP lease file to resolve the machine.

Using a UUID based on machine name minimizes entries in the DHCP lease file. It also provides IP address consistency while the DHCP lease is valid.

Signed-off-by: John Coyle <dx9err@gmail.com>
Set a default disk size. Move init of BaseDriver.SSHUser to Create() to avoid overwrite.

Signed-off-by: John Coyle <dx9err@gmail.com>
…-count, memory-size).

Signed-off-by: John Coyle <dx9err@gmail.com>
@sharifelgamal
Copy link

This has been tested and works with minikube as well. I'm would be happy for this to get merged and to abandon my PR.

@tstromberg
Copy link

Can we merge this?

Copy link

@ermik ermik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is really important to merge in. Without these changes it is impossible to use the project. cc @r2d4

if d.CPU > defaultCPUs {
h.CPUs = d.CPU
}
if d.Memory > defaultMemory {
Copy link

@ermik ermik Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if d.Memory > defaultMemory {
if d.Memory > 0 {
// 0 or minMemory, if known

While unlikely and against better judgement, user should be allowed to lower the request for memory. Same could be done for CPU count, if fractions of CPU are supported by hyperkit.

@maciejzj
Copy link

Any chance this will be merged?

@zazula
Copy link

zazula commented Oct 4, 2020

Can verify that this now makes docker-machine create --driver hyperkit usable on MacOS :)

@spiilmusic
Copy link

Hi @zazula
Did you manage to start some container in hyperkit docker-machine with this changes?

I got the error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:109: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"": unknown.

@zazula
Copy link

zazula commented Oct 23, 2020

Hi @zazula
Did you manage to start some container in hyperkit docker-machine with this changes?

I got the error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:109: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"": unknown.

Try adding this to your docker-machine command:

--engine-env DOCKER_RAMDISK=true

@spiilmusic
Copy link

Try adding this to your docker-machine command:

--engine-env DOCKER_RAMDISK=true

Strange, but with this env I even can't pull image, btw it works normally on vbox machine:

docker pull alpine                                                                                        
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@zazula
Copy link

zazula commented Oct 25, 2020

Try adding this to your docker-machine command:
--engine-env DOCKER_RAMDISK=true

Strange, but with this env I even can't pull image, btw it works normally on vbox machine:

docker pull alpine                                                                                        
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Try with my clone of the repo here:

https://github.com/zazula/docker-machine-driver-hyperkit

brew install golang dep
go get github.com/zazula/docker-machine-driver-hyperkit
cd ~/go/src/github.com/zazula/docker-machine-driver-hyperkit
make build

docker-machine -D create --driver hyperkit --engine-env DOCKER_RAMDISK=true --hyperkit-cpu-count 12 --hyperkit-disk-size 40960 --hyperkit-memory-size 16192  local
[...]

then

$eval $(docker-machine env local)

$docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
188c0c94c7c5: Pull complete 
Digest: sha256:c0e9560cda118f9ec63ddefb4a173a2b2a0347082d7dff7dc14272e7841a5b5a
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

$ docker run -it alpine sh
/ # ls
bin    etc    lib    mnt    proc   run    srv    tmp    var
dev    home   media  opt    root   sbin   sys    usr
/ # exit

@zazula
Copy link

zazula commented Oct 25, 2020

Also, make sure your hyperkit binary is setuid root

@spiilmusic
Copy link

Also, make sure your hyperkit binary is setuid root

It looks like it was trouble with my host /etc/resolv.conf, so docker-machine couldn't access internet. At this time I was able to run containers 🎉
One note: I had to run make build with CGO_ENABLED=1 due to an error: Error creating machine: Error in driver during machine creation: getting MAC address from UUID: Function not supported on CGO_ENABLED=0 binaries

Anyway thx! Now I got significant  increase mount host filesystem performance 🥳

@zazula
Copy link

zazula commented Oct 26, 2020

Also, make sure your hyperkit binary is setuid root

It looks like it was trouble with my host /etc/resolv.conf, so docker-machine couldn't access internet. At this time I was able to run containers 🎉
One note: I had to run make build with CGO_ENABLED=1 due to an error: Error creating machine: Error in driver during machine creation: getting MAC address from UUID: Function not supported on CGO_ENABLED=0 binaries

Anyway thx! Now I got significant  increase mount host filesystem performance 🥳

Great! I don't recall doing anything with the CGO_ENABLED flag but glad you have it working.

I'm working on some fixes for NFS mounts and exposing some of the NFS config flags as --hyperkit-nfs-xxx

@JesusTheHun
Copy link

hi, can someone provide an update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants