forked from kubernetes-sigs/application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.controller
34 lines (29 loc) · 1.31 KB
/
Dockerfile.controller
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Instructions to install API using the installer
# Build and test the controller-manager
FROM golang:1.9.3 as builder
ENV TEST_ASSET_DIR /usr/local/bin
ENV TEST_ASSET_KUBECTL $TEST_ASSET_DIR/kubectl
ENV TEST_ASSET_KUBE_APISERVER $TEST_ASSET_DIR/kube-apiserver
ENV TEST_ASSET_ETCD $TEST_ASSET_DIR/etcd
# Download test framework binaries
ENV TEST_ASSET_URL https://storage.googleapis.com/k8s-c10s-test-binaries
RUN curl ${TEST_ASSET_URL}/etcd-Linux-x86_64 --output $TEST_ASSET_ETCD
RUN curl ${TEST_ASSET_URL}/kube-apiserver-Linux-x86_64 --output $TEST_ASSET_KUBE_APISERVER
RUN curl https://storage.googleapis.com/kubernetes-release/release/v1.9.2/bin/linux/amd64/kubectl --output $TEST_ASSET_KUBECTL
RUN chmod +x $TEST_ASSET_ETCD
RUN chmod +x $TEST_ASSET_KUBE_APISERVER
RUN chmod +x $TEST_ASSET_KUBECTL
# Copy in the go src
WORKDIR /go/src/github.com/kubernetes-sigs/application
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/
# Build and test the API code
RUN go build -a -o controller-manager ./cmd/controller-manager/main.go
RUN go test ./pkg/... ./cmd/...
# Copy the controller-manager into a thin image
FROM ubuntu:latest
# RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/kubernetes-sigs/application/controller-manager .
CMD ["./controller-manager", "--install-crds=false"]