Skip to content

Commit

Permalink
Merge pull request openshift#112 from Nordix/v1alpha2
Browse files Browse the repository at this point in the history
Initial PR on v1alpha2 migration (inc. openshift#111)
  • Loading branch information
russellb committed Oct 9, 2019
2 parents acab6c7 + 4556d4f commit f43e955
Show file tree
Hide file tree
Showing 8,459 changed files with 8,843 additions and 2,885,216 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 2 additions & 4 deletions .travis.yml
@@ -1,13 +1,11 @@
language: go
sudo: false
go:
- "1.11.5"
- "1.12"
before_install:
- go get sigs.k8s.io/kustomize
- ./tools/install_kubebuilder.sh
- make generate
env:
- TARGET=fmt
- TARGET=vet
- TARGET=unit
script: KUBEBUILDER_ASSETS="$(pwd)/kubebuilder/bin/" make $TARGET
script: KUBEBUILDER_ASSETS="$(pwd)/hack/tools/bin/" make $TARGET
62 changes: 47 additions & 15 deletions Dockerfile
@@ -1,15 +1,47 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder
WORKDIR /go/src/github.com/metal3-io/cluster-api-provider-baremetal
COPY . .
RUN go build -o machine-controller-manager ./cmd/manager
RUN go build -o manager ./vendor/sigs.k8s.io/cluster-api/cmd/manager

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
#RUN INSTALL_PKGS=" \
# libvirt-libs openssh-clients genisoimage \
# " && \
# yum install -y $INSTALL_PKGS && \
# rpm -V $INSTALL_PKGS && \
# yum clean all
COPY --from=builder /go/src/github.com/metal3-io/cluster-api-provider-baremetal/manager /
COPY --from=builder /go/src/github.com/metal3-io/cluster-api-provider-baremetal/machine-controller-manager /
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build the manager binary on golang image
FROM registry.hub.docker.com/library/golang:1.12.9 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
ARG goproxy=https://proxy.golang.org
ENV GOPROXY=$goproxy

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the sources
COPY main.go main.go
COPY api/ api/
COPY baremetal/ baremetal/
COPY controllers/ controllers/

# Build
ARG ARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -a -ldflags '-extldflags "-static"' \
-o manager .

# Copy the controller-manager into a thin image
FROM gcr.io/distroless/static:latest
WORKDIR /
COPY --from=builder /workspace/manager .
USER nobody
ENTRYPOINT ["/manager"]

0 comments on commit f43e955

Please sign in to comment.