sigs.k8s.io/cluster-api/bootstrap/kubeadm@v0.0.0-20191016155141-23a891785b60/Dockerfile.dev (about)

     1  # Copyright 2019 The Kubernetes Authors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  # Build the manager binary
    16  FROM golang:1.12.10 as builder
    17  WORKDIR /workspace
    18  
    19  # Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
    20  ARG goproxy=https://proxy.golang.org
    21  ENV GOPROXY=$goproxy
    22  
    23  # Copy the Go Modules manifests
    24  COPY go.mod go.mod
    25  COPY go.sum go.sum
    26  # cache deps before building and copying source so that we don't need to re-download as much
    27  # and so that source changes don't invalidate our downloaded layer
    28  RUN go mod download
    29  
    30  # Copy the go source
    31  COPY main.go main.go
    32  COPY api/ api/
    33  COPY controllers/ controllers/
    34  COPY kubeadm/ kubeadm/
    35  COPY cloudinit/ cloudinit/
    36  COPY internal/ internal/
    37  
    38  # Allow containerd to restart pods by calling /restart.sh (mostly for tilt + fast dev cycles)
    39  # TODO: Remove this on prod and use a multi-stage build
    40  COPY third_party/forked/rerun-process-wrapper/start.sh .
    41  COPY third_party/forked/rerun-process-wrapper/restart.sh .
    42  
    43  # Build and run
    44  RUN go install -v .
    45  RUN mv /go/bin/cluster-api-bootstrap-provider-kubeadm /manager
    46  ENTRYPOINT ["./start.sh", "/manager"]