Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ccm dockerfile to remove building vpcctl binary #671

Merged
merged 1 commit into from
May 10, 2022
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions hack/ccm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ ARG GOLANG_IMAGE=golang:1.17
ARG TARGETPLATFORM=linux/amd64
ARG ARCH=amd64

# Build vpcctl binary
FROM ${GOLANG_IMAGE} as vpc-builder
ARG ARCH
ARG VPC_CONTROLLER_COMMIT
WORKDIR /build
RUN git clone https://github.com/openshift/cloud-provider-vpc-controller
RUN cd cloud-provider-vpc-controller/cmd && git checkout $VPC_CONTROLLER_COMMIT && CGO_ENABLED=0 GOARCH=$ARCH go build \
-ldflags "-s -w" -o /build/vpcctl .

# Build IBM cloud controller manager binary
FROM ${GOLANG_IMAGE} AS ccm-builder
ARG ARCH
Expand All @@ -39,6 +30,5 @@ RUN cd cloud-provider-powervs && git checkout $POWERVS_CLOUD_CONTROLLER_COMMIT &
# Assemble the final image
FROM --platform=$TARGETPLATFORM quay.io/centos/centos:stream8 AS centos-base
LABEL description="IBM PowerVS Cloud Controller Manager"
COPY --from=vpc-builder /build/vpcctl /bin/vpcctl
COPY --from=ccm-builder /build/ibm-cloud-controller-manager /bin/ibm-cloud-controller-manager
ENTRYPOINT [ "/bin/ibm-cloud-controller-manager" ]
10 changes: 4 additions & 6 deletions hack/ccm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@
REGISTRY=gcr.io/k8s-staging-capi-ibmcloud
IMG=powervs-cloud-controller-manager

# VPC_CONTROLLER_COMMIT can be fetched from here https://github.com/openshift/cloud-provider-vpc-controller/commits/master
VPC_CONTROLLER_COMMIT?=9b99b4e
# POWERVS_CLOUD_CONTROLLER_COMMIT can be fetched from here https://github.com/openshift/cloud-provider-powervs/commits/main
POWERVS_CLOUD_CONTROLLER_COMMIT?=a6bfa07
TAG?=$(VPC_CONTROLLER_COMMIT)_$(POWERVS_CLOUD_CONTROLLER_COMMIT)
POWERVS_CLOUD_CONTROLLER_COMMIT?=0b18bec
TAG?=$(POWERVS_CLOUD_CONTROLLER_COMMIT)

build-image-and-push-linux-amd64: init-buildx
{ \
set -e ; \
docker buildx build \
--build-arg TARGETPLATFORM=linux/amd64 --build-arg ARCH=amd64 \
--build-arg VPC_CONTROLLER_COMMIT=$(VPC_CONTROLLER_COMMIT) --build-arg POWERVS_CLOUD_CONTROLLER_COMMIT=$(POWERVS_CLOUD_CONTROLLER_COMMIT)\
--build-arg POWERVS_CLOUD_CONTROLLER_COMMIT=$(POWERVS_CLOUD_CONTROLLER_COMMIT)\
-t $(REGISTRY)/$(IMG):$(TAG)_linux_amd64 . --push --target centos-base; \
}

Expand All @@ -35,7 +33,7 @@ build-image-and-push-linux-ppc64le: init-buildx
set -e ; \
docker buildx build \
--build-arg TARGETPLATFORM=linux/ppc64le --build-arg ARCH=ppc64le\
--build-arg VPC_CONTROLLER_COMMIT=$(VPC_CONTROLLER_COMMIT) --build-arg POWERVS_CLOUD_CONTROLLER_COMMIT=$(POWERVS_CLOUD_CONTROLLER_COMMIT)\
--build-arg POWERVS_CLOUD_CONTROLLER_COMMIT=$(POWERVS_CLOUD_CONTROLLER_COMMIT)\
-t $(REGISTRY)/$(IMG):$(TAG)_linux_ppc64le . --push --target centos-base; \
}

Expand Down