Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 79c9cbe

Browse files
author
David Chung
authored
make libvirt optional (#718)
Signed-off-by: David Chung <[email protected]>
1 parent 0755e99 commit 79c9cbe

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ E2E_TESTS?=true
1414
#Source file target
1515
SRCS := $(shell find . -type f -name '*.go')
1616

17+
# Set the go build tags here. By default we disable building of libvirt
18+
GO_BUILD_TAGS?=nolibvirt
19+
1720
# Allow turning off function inlining and variable registerization
1821
ifeq (${DISABLE_OPTIMIZATION},true)
1922
GO_GCFLAGS=-gcflags "-N -l"
@@ -88,7 +91,7 @@ clean:
8891

8992
define binary_target_template
9093
build/$(1): $(SRCS)
91-
go build -o build/$(1)$(EXE_EXT) \
94+
go build -o build/$(1)$(EXE_EXT) -tags $(GO_BUILD_TAGS) \
9295
-ldflags "-X github.com/docker/infrakit/pkg/cli.Version=$(VERSION) -X github.com/docker/infrakit/pkg/cli.Revision=$(REVISION) -X github.com/docker/infrakit/pkg/util/docker.ClientVersion=$(DOCKER_CLIENT_VERSION)" $(2)
9396
endef
9497
define define_binary_target

cmd/infrakit/libvirt.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// +build libvirt
2+
3+
package main
4+
5+
import (
6+
_ "github.com/docker/infrakit/pkg/run/v0/libvirt"
7+
)

cmd/infrakit/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import (
5353
_ "github.com/docker/infrakit/pkg/run/v0/image"
5454
_ "github.com/docker/infrakit/pkg/run/v0/ingress"
5555
_ "github.com/docker/infrakit/pkg/run/v0/kubernetes"
56-
_ "github.com/docker/infrakit/pkg/run/v0/libvirt"
5756
_ "github.com/docker/infrakit/pkg/run/v0/maas"
5857
_ "github.com/docker/infrakit/pkg/run/v0/manager"
5958
_ "github.com/docker/infrakit/pkg/run/v0/oracle"

cmd/infrakit/plugin/plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
151151

152152
parsedRules := []launch.Rule{}
153153

154+
log.Info("config", "url", *configURL)
155+
154156
if *configURL != "" {
155157
buff, err := processTemplate(*configURL)
156158
if err != nil {

dockerfiles/Dockerfile.installer

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
FROM golang:1.8-alpine
22

3-
RUN apk add --update git make gcc musl-dev wget ca-certificates openssl libvirt-dev git openssh
3+
RUN apk add --update git make gcc musl-dev wget ca-certificates openssl libvirt-dev libvirt-lxc libvirt-qemu git openssh
44

55
ENV GOPATH /go
66
ENV PATH /go/bin:$PATH
77

88
COPY dockerfiles/build-infrakit /usr/local/bin/
9-
COPY dockerfiles/build-hyperkit /usr/local/bin/
109

1110
# Add source code
1211
Add . /go/src/github.com/docker/infrakit/

docs/install

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Installs infrakit by cross compiling locally inside a docker container.
44

5-
if [[ "$(which docker)" == "" ]]; then
5+
if [ "$(which docker)" = "" ]; then
66
echo "You must have Docker locally."
77
exit -1
88
fi
@@ -22,5 +22,5 @@ case "$(uname)" in
2222
esac
2323

2424

25-
docker run --rm -v $dir:/build infrakit/installer build-infrakit $target
25+
docker run --rm -v $dir:/build infrakit/installer:latest build-infrakit $target
2626
sudo cp ./infrakit /usr/local/bin

0 commit comments

Comments
 (0)