Revision d12a812cb27037a7254bd81d8e4edb0e082b63b6 authored by Joe Stringer on 18 January 2022, 23:27:56 UTC, committed by Joe Stringer on 19 January 2022, 00:41:46 UTC
Signed-off-by: Joe Stringer <joe@cilium.io>
1 parent 98e7eba
cilium-operator.Dockerfile
# (first line comment needed for DOCKER_BUILDKIT use)
#
ARG BASE_IMAGE=scratch
FROM docker.io/library/golang:1.15.15 as builder
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
LABEL maintainer="maintainer@cilium.io"
ADD . /go/src/github.com/cilium/cilium
WORKDIR /go/src/github.com/cilium/cilium/operator
ARG NOSTRIP
ARG LOCKDEBUG
ARG RACE
RUN make RACE=$RACE NOSTRIP=$NOSTRIP LOCKDEBUG=$LOCKDEBUG cilium-operator
WORKDIR /go/src/github.com/cilium/cilium
RUN make licenses-all
FROM docker.io/library/alpine:3.12.0 as certs
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
RUN apk --update add ca-certificates
FROM docker.io/library/golang:1.15.15 as gops
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
RUN go get -d github.com/google/gops && \
cd /go/src/github.com/google/gops && \
git checkout -b v0.3.10 v0.3.10 && \
git --no-pager remote -v && \
git --no-pager log -1 && \
CGO_ENABLED=0 go install && \
strip /go/bin/gops
FROM ${BASE_IMAGE}
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
LABEL maintainer="maintainer@cilium.io"
ENV GOPS_CONFIG_DIR=/
COPY --from=builder /go/src/github.com/cilium/cilium/operator/cilium-operator /usr/bin/cilium-operator
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=gops /go/bin/gops /bin/gops
COPY --from=builder /go/src/github.com/cilium/cilium/LICENSE.all /LICENSE.all
WORKDIR /
# FIXME Remove me once we add support for Go 1.16
ENV GODEBUG="madvdontneed=1"
CMD ["/usr/bin/cilium-operator"]
Computing file changes ...