Skip to content

Commit

Permalink
Fork: Modify Dockerfiles to support Gitlab builds
Browse files Browse the repository at this point in the history
We require a small number of changes to the Dockerfiles to succesfully
build within Gitlab.
  • Loading branch information
jaredledvina authored and antonipp committed Dec 5, 2024
1 parent 614546d commit b8a3050
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions images/operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium \
./build-gops.sh

FROM ${BASE_IMAGE} AS release

# Datadog Modification: operator has to run as root
USER root

# TARGETOS is an automatic platform ARG enabled by Docker BuildKit.
ARG TARGETOS
# TARGETARCH is an automatic platform ARG enabled by Docker BuildKit.
Expand Down
8 changes: 5 additions & 3 deletions images/runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium/images/r

FROM ${UBUNTU_IMAGE} AS rootfs

# Datadog modification: to be able to run APT we need to be root, Cilium also need to run as root
USER root

# Change the number to force the generation of a new git-tree SHA. Useful when
# we want to re-run 'apt-get upgrade' for stale images.
ENV FORCE_BUILD=3
Expand Down Expand Up @@ -60,6 +63,5 @@ COPY --from=bpftool-dist /test /test
RUN /test/bin/cst -C /test/llvm
RUN /test/bin/cst -C /test/bpftool

FROM scratch
LABEL maintainer="[email protected]"
COPY --from=rootfs / /
# Datadog modification: do not squash the layers to not lose GBI labels
FROM rootfs

0 comments on commit b8a3050

Please sign in to comment.