forked from machine-drivers/docker-machine-kvm
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify for use by CRC; add bundle logic, libvirt rename, etc
- Loading branch information
Showing
12 changed files
with
108 additions
and
251 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM centos:7 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
MAINTAINER CodeReady Containers | ||
|
||
ARG MACHINE_VERSION | ||
ARG GO_VERSION | ||
|
@@ -9,10 +9,10 @@ ENV GOPATH /go | |
RUN yum install -y libvirt-devel curl git gcc | ||
RUN curl -sSL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xzf - | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/go/bin | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/docker/machine.git /go/src/github.com/docker/machine | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/code-ready/machine.git /go/src/github.com/code-ready/machine | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
COPY . /go/src/github.com/code-ready/machine-driver-libvirt | ||
WORKDIR /go/src/github.com/code-ready/machine-driver-libvirt | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm | ||
RUN go install -v ./cmd/machine-driver-libvirt |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM ubuntu:16.04 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
MAINTAINER CodeReady Containers | ||
|
||
ARG MACHINE_VERSION | ||
ARG GO_VERSION | ||
|
@@ -9,10 +9,10 @@ ENV GOPATH /go | |
RUN apt-get update && apt-get install -y libvirt-dev curl git gcc | ||
RUN curl -sSL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xzf - | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/go/bin | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/docker/machine.git /go/src/github.com/docker/machine | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/code-ready/machine.git /go/src/github.com/code-ready/machine | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
COPY . /go/src/github.com/code-ready/machine-driver-libvirt | ||
WORKDIR /go/src/github.com/code-ready/machine-driver-libvirt | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm | ||
RUN go install -v ./cmd/machine-driver-libvirt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default: build | ||
|
||
build: | ||
GOGC=off go build -i -o machine-driver-libvirt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/code-ready/machine-driver-libvirt" | ||
"github.com/code-ready/machine/libmachine/drivers/plugin" | ||
) | ||
|
||
func main() { | ||
plugin.RegisterDriver(libvirt.NewDriver("default", "path")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package libvirt | ||
|
||
const ( | ||
DriverName = "libvirt" | ||
DriverVersion = "0.9.0" | ||
|
||
connectionString = "qemu:///system" | ||
privateNetworkName = "crc" | ||
dnsmasqLeases = "/var/lib/libvirt/dnsmasq/%s.leases" | ||
dnsmasqStatus = "/var/lib/libvirt/dnsmasq/%s.status" | ||
defaultSSHUser = "core" | ||
|
||
domainXMLTemplate = `<domain type='kvm'> | ||
<name>{{.MachineName}}</name> | ||
<memory unit='MB'>{{.Memory}}</memory> | ||
<vcpu>{{.CPU}}</vcpu> | ||
<features><acpi/><apic/><pae/></features> | ||
<cpu mode='host-passthrough'></cpu> | ||
<os> | ||
<type>hvm</type> | ||
<boot dev='hd'/> | ||
<bootmenu enable='no'/> | ||
</os> | ||
<devices> | ||
<disk type='file' device='disk'> | ||
<driver name='qemu' type='qcow2' cache='{{.CacheMode}}' io='{{.IOMode}}' /> | ||
<source file='{{.DiskPath}}'/> | ||
<target dev='hda' bus='ide'/> | ||
</disk> | ||
<graphics type='vnc' autoport='yes' listen='127.0.0.1'> | ||
<listen type='address' address='127.0.0.1'/> | ||
</graphics> | ||
<interface type='network'> | ||
<source network='{{.Network}}'/> | ||
</interface> | ||
<interface type='network'> | ||
<source network='{{.PrivateNetwork}}'/> | ||
</interface> | ||
</devices> | ||
</domain>` | ||
networkXML = `<network> | ||
<name>%s</name> | ||
<ip address='%s' netmask='%s'> | ||
<dhcp> | ||
<range start='%s' end='%s'/> | ||
</dhcp> | ||
</ip> | ||
</network>` | ||
) |
Oops, something went wrong.