docker-machine-driver-hyperkit icon indicating copy to clipboard operation
docker-machine-driver-hyperkit copied to clipboard

docker-machine tweaks in support of PR #13

Open dx9 opened this issue 6 years ago • 12 comments

Depends on #13

Tested against docker-machine.

dx9 avatar Sep 24 '19 18:09 dx9

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.

sharifelgamal avatar Oct 16 '19 21:10 sharifelgamal

Can we merge this?

tstromberg avatar Dec 16 '19 19:12 tstromberg

Any chance this will be merged?

maciejzj avatar Sep 27 '20 12:09 maciejzj

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

zazula avatar Oct 04 '20 15:10 zazula

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.

spiilmusic avatar Oct 23 '20 08:10 spiilmusic

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

zazula avatar Oct 23 '20 10:10 zazula

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)

spiilmusic avatar Oct 23 '20 10:10 spiilmusic

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 avatar Oct 25 '20 23:10 zazula

Also, make sure your hyperkit binary is setuid root

zazula avatar Oct 25 '20 23:10 zazula

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 🥳

spiilmusic avatar Oct 26 '20 16:10 spiilmusic

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

zazula avatar Oct 26 '20 16:10 zazula

hi, can someone provide an update on this ?

JesusTheHun avatar Nov 30 '20 17:11 JesusTheHun