From 0fc1b81c1b101ee3521f29e949d633c74c6bc991 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Wed, 17 Oct 2018 15:30:45 +0200 Subject: [PATCH] update docker and Makefile --- Dockerfile | 11 +++++++---- Makefile | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index da93150fe5..8ce89a537e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,13 +22,16 @@ WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws # This expects that the context passed to the docker build command is # the cluster-api-provider-aws directory. # e.g. docker build -t -f -COPY . . +COPY pkg/ pkg/ +COPY cmd/ cmd/ +COPY vendor/ vendor/ -RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller -RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/sigs.k8s.io/cluster-api/cmd/controller-manager + +RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go build -o /go/bin/machine-controller-manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/manager +RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go build -o /go/bin/manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/sigs.k8s.io/cluster-api/cmd/manager # Final container FROM openshift/origin-base RUN yum install -y ca-certificates openssh -COPY --from=builder /go/bin/machine-controller /go/bin/controller-manager . +COPY --from=builder /go/bin/manager /go/bin/machine-controller-manager / diff --git a/Makefile b/Makefile index 76ad19d786..d128206b06 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ endif VERSION ?= $(shell git describe --always --abbrev=7) MUTABLE_TAG ?= latest -IMAGE = origin-libvirt-machine-controllers +IMAGE = origin-aws-machine-controllers .PHONY: all all: generate build images check @@ -71,7 +71,7 @@ bin: .PHONY: build build: ## build binary - $(DOCKER_CMD) go install $(GOGCFLAGS) -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller + $(DOCKER_CMD) go install $(GOGCFLAGS) -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/manager aws-actuator: $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/aws-actuator sigs.k8s.io/cluster-api-provider-aws/cmd/aws-actuator @@ -103,7 +103,7 @@ test-e2e: ## Run e2e test .PHONY: lint lint: ## Go lint your code - hack/go-lint.sh -min_confidence 0.3 $$(go list -f '{{ .ImportPath }}' ./... | grep -v 'sigs.k8s.io/cluster-api-provider-aws/test') + hack/go-lint.sh -min_confidence 0.3 $$(go list -f '{{ .ImportPath }}' ./... | grep -v -e 'sigs.k8s.io/cluster-api-provider-aws/test' -e /go/src/sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client/mock) .PHONY: fmt fmt: ## Go fmt your code