Skip to content

Commit

Permalink
update docker and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
enxebre committed Oct 17, 2018
1 parent ea4fb15 commit 0fc1b81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tag> -f <this_Dockerfile> <path_to_cluster-api-aws>
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 /
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0fc1b81

Please sign in to comment.