Building Cross Platform Images of Operator #2482
-
Hey there! I want to build cross platform images of operator. When I execute |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
To build multiarch images, run
The default platforms for multiarch images are See https://submariner.io/development/shipyard/images/#multi-arch-images for details. You’ll need to ensure that builders are available for the platforms you’re interested in; the images will be built as tarballs in the |
Beta Was this translation helpful? Give feedback.
-
Hi again! TL;DR: I built images and imported tarballs successfully with the command above however there has been some troubles when I tried to use those images. Container runtime cannot start entrypoint since it cannot find Normally, if I guarantee that there is a When I try to run multiarch image in my local machine, I got the following error meaning no binary found named
Here is the Dockerfile that builds both single arch and multiarch images: ARG BASE_BRANCH
ARG SOURCE=/go/src/github.com/submariner-io/submariner-operator
FROM --platform=${BUILDPLATFORM} quay.io/submariner/shipyard-dapper-base:${BASE_BRANCH} AS builder
ARG SOURCE
ARG TARGETPLATFORM
COPY . ${SOURCE}
RUN make -C ${SOURCE} LOCAL_BUILD=1 bin/${TARGETPLATFORM}/submariner-operator
FROM --platform=${TARGETPLATFORM} scratch
ARG SOURCE
ARG TARGETPLATFORM
ENV USER_UID=1001 PATH=/
# install operator binary
COPY --from=builder ${SOURCE}/bin/${TARGETPLATFORM}/submariner-operator /submariner-operator
ENTRYPOINT ["/submariner-operator"]
USER ${USER_UID} So I figured it should be okay if I can put binaries under The error didn't change after I updated the paths of binaries. When I digged the logs of
I think the problem is that Also I'm facing with issues when I try to generate binaries by
I wonder if I'm skipping some of the necessary steps I should do before I build multiarch images. Kinda stuck here. |
Beta Was this translation helpful? Give feedback.
To build multiarch images, run
The default platforms for multiarch images are
linux/amd64
andlinux/arm64
.See https://submariner.io/development/shipyard/images/#multi-arch-images for details. You’ll need to ensure that builders are available for the platforms you’re interested in; the images will be built as tarballs in the
package
directory. See https://github.com/submariner-io/submariner-operator/blob/devel/.github/workflows/multiarch.yml for inspiration.