Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@
# Reproducible builder image
FROM openshift/origin-release:golang-1.10 as builder

# Workaround a bug in imagebuilder (some versions) where this dir will not be auto-created.
RUN mkdir -p /go/src/github.com/openshift/cluster-api-provider-libvirt
# Copy in the go src
WORKDIR /go/src/github.com/openshift/cluster-api-provider-libvirt

# This expects that the context passed to the docker build command is
# the cluster-api-provider-libvirt directory.
# e.g. docker build -t <tag> -f <this_Dockerfile> <path_to_cluster-api-libvirt>
COPY . .
RUN GOPATH=/go CGO_ENABLED=1 go install ./cmd/machine-controller
RUN GOPATH=/go CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' github.com/openshift/cluster-api-provider-libvirt/vendor/sigs.k8s.io/cluster-api/cmd/controller-manager

# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o machine-controller github.com/openshift/cluster-api-provider-libvirt/cmd/manager

# Copy the controller-manager into a thin image

# Final container
FROM openshift/origin-base
RUN yum install -y ca-certificates libvirt-libs openssh-clients
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't those libraries needed to connect to libvirt hypervisor via qemu+ssh method?


COPY --from=builder /go/bin/machine-controller /go/bin/controller-manager /
WORKDIR /root/
COPY --from=builder /go/src/github.com/openshift/cluster-api-provider-libvirt/machine-controller .
Loading