{"id":18832840,"url":"https://github.com/linka-cloud/docker-machine-driver-kubevirt","last_synced_at":"2026-05-09T09:43:45.973Z","repository":{"id":114453187,"uuid":"570207718","full_name":"linka-cloud/docker-machine-driver-kubevirt","owner":"linka-cloud","description":"KubeVirt driver for Docker Machine","archived":false,"fork":false,"pushed_at":"2022-11-25T16:28:14.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T07:23:43.413Z","etag":null,"topics":["ci","d2vm","docker","docker-machine","docker-machine-driver","gitlab-ci","gitlab-runner","kubernetes","kubevirt","libvirt","virtual-machine","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linka-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-24T15:30:11.000Z","updated_at":"2023-10-06T15:04:49.000Z","dependencies_parsed_at":"2023-06-07T23:30:49.647Z","dependency_job_id":null,"html_url":"https://github.com/linka-cloud/docker-machine-driver-kubevirt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fdocker-machine-driver-kubevirt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fdocker-machine-driver-kubevirt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fdocker-machine-driver-kubevirt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fdocker-machine-driver-kubevirt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linka-cloud","download_url":"https://codeload.github.com/linka-cloud/docker-machine-driver-kubevirt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768926,"owners_count":19693763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","d2vm","docker","docker-machine","docker-machine-driver","gitlab-ci","gitlab-runner","kubernetes","kubevirt","libvirt","virtual-machine","virtualization"],"created_at":"2024-11-08T01:59:09.569Z","updated_at":"2026-01-25T20:30:18.464Z","avatar_url":"https://github.com/linka-cloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Machine driver for KubeVirt\n\nThis is a **Docker Machine** driver for *KubeVirt*. It allows you to use *Docker Machine* to create Docker hosts on top of *KubeVirt*.\n\n*Status*: **Alpha**\n\n## Overview\n\nThe driver is designed to be used with *gitlab-runner* and run inside a *Kubernetes* cluster.\nNo state is persisted between restart, so the driver is not suitable for long-running Docker hosts.\n\n## Requirements\n\n* A Kubernetes cluster with KubeVirt installed\n* Access to the Kubernetes API server\n* Access to the Kubernetes Pod network\n\n## Example Usage\n\nDeploy the driver as a sleeping Kubernetes Deployment in the **default** namespace:\n\n```bash\n# Deploy docker-machine\nkubectl apply -k ./deploy/default\n```\n\nExec into the driver pod:\n\n```bash\nkubectl exec -i -t docker-machine-5b595cf65d-q76bn -- sh\n\n/ $ docker-machine create --driver kubevirt --help\nUsage: docker-machine create [OPTIONS] [arg...]\n\nCreate a machine\n\nDescription:\n   Run 'docker-machine create --driver name --help' to include the create flags for that driver in the help text.\n\nOptions:\n\n   --driver, -d \"virtualbox\"                                                                            Driver to create machine with. [$MACHINE_DRIVER]\n   --engine-env [--engine-env option --engine-env option]                                               Specify environment variables to set in the engine\n   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option]     Specify insecure registries to allow with the created engine\n   --engine-install-url \"https://get.docker.com\"                                                        Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]\n   --engine-label [--engine-label option --engine-label option]                                         Specify labels for the created engine\n   --engine-opt [--engine-opt option --engine-opt option]                                               Specify arbitrary flags to include with the created engine in the form flag=value\n   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option]           Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]\n   --engine-storage-driver                                                                              Specify a storage driver to use with the engine\n   --kubevirt-cpu-count \"1\"                                                                             Number of CPUs\n   --kubevirt-image \"linkacloud/d2vm-docker-machine:alpine\"                                             Container Disk Image to use for the VM, it should provide docker, sshd and qemu-guest-agent\n   --kubevirt-kubeconfig                                                                                Path to the Kubernetes config file, if not specified, the default config path or in-cluster config will be used [$KUBECONFIG]\n   --kubevirt-memory \"1024\"                                                                             Size of memory for host in MB\n   --kubevirt-namespace \"default\"                                                                       Namespace to use for the VM, if not specified, the default namespace will be used\n   --swarm                                                                                              Configure Machine to join a Swarm cluster\n   --swarm-addr                                                                                         addr to advertise for Swarm (default: detect and use the machine IP)\n   --swarm-discovery                                                                                    Discovery service to use with Swarm\n   --swarm-experimental                                                                                 Enable Swarm experimental features\n   --swarm-host \"tcp://0.0.0.0:3376\"                                                                    ip/socket to listen on for Swarm master\n   --swarm-image \"swarm:latest\"                                                                         Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]\n   --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option]                                   Define arbitrary flags for Swarm join\n   --swarm-master                                                                                       Configure Machine to be a Swarm master\n   --swarm-opt [--swarm-opt option --swarm-opt option]                                                  Define arbitrary flags for Swarm master\n   --swarm-strategy \"spread\"                                                                            Define a default scheduling strategy for Swarm\n   --tls-san [--tls-san option --tls-san option]                                                        Support extra SANs for TLS certs\n   \n# Create a new Docker host with the driver\n/ $ docker-machine create --driver kubevirt --kubevirt-cpu-count 2 --kubevirt-memory 2048 docker-0\nCreating CA: /root/.docker/machine/certs/ca.pem\nCreating client certificate: /root/.docker/machine/certs/cert.pem\nRunning pre-create checks...\nCreating machine...\n(docker-0) Creating SSH key...\n(docker-0) Creating VM docker-0 in namespace default\nWaiting for machine to be running, this may take a few minutes...\nDetecting operating system of created instance...\nWaiting for SSH to be available...\nDetecting the provisioner...\nProvisioning with alpine...\nCopying certs to the local machine directory...\nCopying certs to the remote machine...\nSetting Docker configuration on the remote daemon...\nChecking connection to Docker...\nDocker is up and running!\nTo see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env docker-0\n\n/ $ docker-machine ls\nNAME       ACTIVE   DRIVER     STATE     URL                      SWARM   DOCKER      ERRORS\ndocker-0   -        kubevirt   Running   tcp://10.42.0.152:2376           v20.10.20\n\n# Connect to the Docker host\n/ $ eval $(docker-machine env docker-0)\n\n# Run a container on the Docker host\n/ $ docker run -d --name whoami -p 80:80 traefik/whoami\nUnable to find image 'traefik/whoami:latest' locally\nlatest: Pulling from traefik/whoami\n029cd1bf7e7c: Pull complete\ne73b694ead4f: Pull complete\n99df6e9e9886: Pull complete\nDigest: sha256:24829edb0dbaea072dabd7d902769168542403a8c78a6f743676af431166d7f0\nStatus: Downloaded newer image for traefik/whoami:latest\ne3cb2a13140635bbaefab25034bbcc9b17abe547d66d99e72168cd4703db6a44\n\n/ $ docker ps\nCONTAINER ID   IMAGE            COMMAND     CREATED          STATUS          PORTS                               NAMES\ne3cb2a131406   traefik/whoami   \"/whoami\"   24 seconds ago   Up 21 seconds   0.0.0.0:80-\u003e80/tcp, :::80-\u003e80/tcp   whoami\n\n# Connect to the container\n/ $ curl $(docker-machine ip docker-0)\nHostname: e3cb2a131406\nIP: 127.0.0.1\nIP: 172.17.0.2\nRemoteAddr: 10.42.0.162:60974\nGET / HTTP/1.1\nHost: 10.42.0.163\nUser-Agent: curl/7.86.0\nAccept: */*\n\n# Destroy the Docker host\n/ $ docker-machine rm -f -y docker-0\nAbout to remove docker-0\nWARNING: This action will delete both local reference and remote instance.\n(docker-0) Getting IP address for VM docker-0 in namespace default\n(docker-0) Killing vm docker-0 in namespace default\nSuccessfully removed docker-0\n\n```\n\n## Docker images\n\nThe **KubeVirt** container disk images are build using [d2vm](https://github.com/linka-cloud/d2vm) and\navailable in two flavors:\n- ubuntu-22.04\n- alpine 3.16\n\nThe definitions are located in the [images directory](./images).\n\nIn order to be able to provision Alpine based docker host, a fork of the [gitlab's docker-machine](https://gitlab.com/linka-cloud/docker-machine)\nis used.\n\nThe *KubeVirt* images must have the **qemu-guest-agent** installed and running in order to provision the ssh public key.\n\n### TODO:\n- [ ] Use recommended resources labels\n- [ ] Customize DNS configuration\n- [ ] Run as non-root user\n- [ ] *Gitlab Runner* example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fdocker-machine-driver-kubevirt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinka-cloud%2Fdocker-machine-driver-kubevirt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fdocker-machine-driver-kubevirt/lists"}