Skip to content

Commit

Permalink
update makefile & image patch with new image name
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Sep 4, 2019
1 parent 58d8e3d commit 0b45ecc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 44 deletions.
54 changes: 14 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,13 @@
# limitations under the License.

# Build the manager binary
#FROM golang:1.12.9 as builder
#
## Copy in the go src
#WORKDIR ${GOPATH}/src/sigs.k8s.io/cluster-api-provider-openstack
#COPY pkg/ pkg/
#COPY cmd/ cmd/
#COPY vendor/ vendor/
#COPY api/ api/
#COPY controllers/ controllers/
#COPY main.go main.go
#COPY go.mod go.mod
#COPY go.sum go.sum
#
## Build
#RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on GOFLAGS="-mod=vendor" \
# go build -a -ldflags '-extldflags "-static"' \
# -o manager sigs.k8s.io/cluster-api-provider-openstack
#
## Copy the controller-manager into a thin image
#FROM gcr.io/distroless/static:latest
#WORKDIR /
#COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-openstack/manager .
#USER nobody
#ENTRYPOINT ["/manager"]

# Build the manager binary
FROM golang:1.12.9
FROM 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

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
Expand All @@ -54,17 +28,17 @@ COPY go.sum go.sum
RUN go mod download

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

# Allow containerd to restart pods by calling /restart.sh (mostly for tilt + fast dev cycles)
# TODO: Remove this on prod and use a multi-stage build
COPY third_party/forked/rerun-process-wrapper/start.sh .
COPY third_party/forked/rerun-process-wrapper/restart.sh .
# Build
ARG ARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -a -ldflags '-extldflags "-static"' \
-o manager .

# Build and run
RUN go install -v .
RUN mv /go/bin/cluster-api-provider-openstack /manager
ENTRYPOINT ["./start.sh", "/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"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ MOCKGEN := $(TOOLS_BIN_DIR)/mockgen

# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
STAGING_REGISTRY := gcr.io/k8s-staging-cluster-api-openstack
PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/cluster-api-openstack
IMAGE_NAME ?= cluster-api-openstack-controller
STAGING_REGISTRY := gcr.io/k8s-staging-capi-openstack
PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/capi-openstack
IMAGE_NAME ?= capi-openstack-controller
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
TAG ?= dev
ARCH ?= amd64
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:latest
- image: gcr.io/k8s-staging-capi-openstack/capi-openstack-controller-ppc64le:latest
name: manager

0 comments on commit 0b45ecc

Please sign in to comment.