-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Given the underlying native library, C lib and other OS lib dependencies sneak in, so this uses a few different Dockerfiles to build binaries targetted at specific OSes.
- Loading branch information
Daniel Hiltgen
committed
Apr 17, 2017
1 parent
72c6ea9
commit f328c4b
Showing
7 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
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,2 +1,3 @@ | ||
cmd/docker-machine-driver-kvm/docker-machine-driver-kvm | ||
*.sw* | ||
docker-machine-driver-kvm-* |
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,15 @@ | ||
FROM alpine:3.4 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
|
||
ARG MACHINE_VERSION | ||
ENV GOPATH /go | ||
|
||
RUN apk -v add --update libvirt-dev curl go git musl-dev gcc | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/docker/machine.git /go/src/github.com/docker/machine | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm |
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,15 @@ | ||
FROM alpine:3.5 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
|
||
ARG MACHINE_VERSION | ||
ENV GOPATH /go | ||
|
||
RUN apk -v add --update libvirt-dev curl go git musl-dev gcc | ||
RUN git clone --branch ${MACHINE_VERSION} https://github.com/docker/machine.git /go/src/github.com/docker/machine | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm |
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,18 @@ | ||
FROM centos:7 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
|
||
ARG MACHINE_VERSION | ||
ARG GO_VERSION | ||
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 | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm |
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,18 @@ | ||
FROM ubuntu:14.04 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
|
||
ARG MACHINE_VERSION | ||
ARG GO_VERSION | ||
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 | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm |
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,18 @@ | ||
FROM ubuntu:16.04 | ||
|
||
MAINTAINER Daniel Hiltgen <[email protected]> | ||
|
||
ARG MACHINE_VERSION | ||
ARG GO_VERSION | ||
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 | ||
|
||
COPY . /go/src/github.com/dhiltgen/docker-machine-kvm | ||
WORKDIR /go/src/github.com/dhiltgen/docker-machine-kvm | ||
RUN go get -v -d ./... | ||
|
||
RUN go install -v ./cmd/docker-machine-driver-kvm |
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,37 @@ | ||
PREFIX=docker-machine-driver-kvm | ||
MACHINE_VERSION=v0.10.0 | ||
GO_VERSION=1.8.1 | ||
DESCRIBE=$(shell git describe --tags) | ||
|
||
TARGETS=$(addprefix $(PREFIX)-, alpine3.4 alpine3.5 ubuntu14.04 ubuntu16.04 centos7) | ||
|
||
build: $(TARGETS) | ||
|
||
$(PREFIX)-%: Dockerfile.% | ||
docker rmi -f $@ >/dev/null 2>&1 || true | ||
docker rm -f $@-extract > /dev/null 2>&1 || true | ||
echo "Building binaries for $@" | ||
docker build --build-arg "MACHINE_VERSION=$(MACHINE_VERSION)" --build-arg "GO_VERSION=$(GO_VERSION)" -t $@ -f $< . | ||
docker create --name $@-extract $@ sh | ||
docker cp $@-extract:/go/bin/docker-machine-driver-kvm ./ | ||
mv ./docker-machine-driver-kvm ./$@ | ||
docker rm $@-extract || true | ||
docker rmi $@ || true | ||
|
||
clean: | ||
rm -f ./$(PREFIX)-* | ||
|
||
|
||
release: build | ||
@echo "Paste the following into the release page on github and upload the binaries..." | ||
@echo "" | ||
@for bin in $(PREFIX)-* ; do \ | ||
target=$$(echo $${bin} | cut -f5- -d-) ; \ | ||
md5=$$(md5sum $${bin}) ; \ | ||
echo "* $${target} - md5: $${md5}" ; \ | ||
echo '```' ; \ | ||
echo " curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/$(DESCRIBE)/$${bin} > /usr/local/bin/$(PREFIX) \\ " ; \ | ||
echo " chmod +x /usr/local/bin/$(PREFIX)" ; \ | ||
echo '```' ; \ | ||
done | ||
|