forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add new multi-platform operator image
This intial version includes all operator falavours, since parametrisation needs some more work to be fully integrated, and it's better to avoid duplication of Dockerfiles. Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
- Loading branch information
1 parent
12c70c8
commit efc7d4b
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# syntax=docker/dockerfile:1.1-experimental | ||
|
||
# Copyright 2020 Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
ARG CILIUM_BUILDER_IMAGE=docker.io/cilium/cilium-builder-dev:b030f1ed16c21608d78564124a870a18ca485444 | ||
ARG CA_CERTIFICATES_IMAGE=docker.io/cilium/ca-certificates:69a9f5d66ff96bf97e8b9dc107e92aa9ddbdc9a8 | ||
|
||
FROM --platform=linux/amd64 ${CILIUM_BUILDER_IMAGE} as builder | ||
|
||
ARG NOSTRIP | ||
ARG LOCKDEBUG | ||
|
||
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \ | ||
make -C operator \ | ||
NOSTRIP=$NOSTRIP LOCKDEBUG=$LOCKDEBUG PKG_BUILD=1 \ | ||
&& mkdir -p /out/linux/amd64/usr/bin && mv operator/cilium-operator* /out/linux/amd64/usr/bin | ||
|
||
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \ | ||
env GOARCH=arm64 \ | ||
make -C operator \ | ||
NOSTRIP=$NOSTRIP LOCKDEBUG=$LOCKDEBUG PKG_BUILD=1 \ | ||
&& mkdir -p /out/linux/arm64/usr/bin && mv operator/cilium-operator* /out/linux/arm64/usr/bin | ||
|
||
|
||
FROM ${CA_CERTIFICATES_IMAGE} | ||
ARG TARGETPLATFORM | ||
LABEL maintainer="maintainer@cilium.io" | ||
|
||
COPY --from=builder /out/${TARGETPLATFORM} / | ||
|
||
WORKDIR / | ||
CMD ["/usr/bin/cilium-operator-generic"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2020 Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# since this is image is built with root context, most of the files | ||
# need to be excluded for faster builds and to avoid spoiling build | ||
# cache due to unchecked files (like configs or random binaries) | ||
* | ||
|
||
# must-have toplevel files | ||
!/Makefile* | ||
!/go.sum | ||
!/go.mod | ||
!/VERSION | ||
# TODO: this is currently a make dependency, but should be removed | ||
# in the future | ||
!/Dockerfile | ||
|
||
# directories | ||
!/api | ||
!/pkg | ||
!/vendor | ||
!/operator |