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

Switch operator back to distroless base image #601

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

HadrienPatte
Copy link
Member

When we migrated all cilium images to a FIPS base in #600 we had to use a full ubuntu base image everywhere because we didn't have a FIPS distroless base image. This means that the operator and clustermesh images moved from a distroless base to an ubuntu base in order to have a FIPS base.
Now that we have FIPS distroless images, we can move the operator and clustermesh images back to a distroless base without loosing any FIPSiness.

Additional goodies:

  • We have a root variant of the distroless fips image, meaning we can drop a USER root modification from the operator Dockerfile (see bfee99c)
  • Similarly, we can set the TARGET argument of the cilium-runtime image build job to drop a a datadog patch from that dockerfile
  • The last manual Dockerfile modification from bfee99c is the USER root line in the runtime image dockerfile, we can get rid of it when we have a root variant of the ubuntu FIPS GBI image (asked about it here)

I tested that the cilium-runtime built with target rootfs properly preserves the labels of its underlying base image:

$ docker inspect registry.ddbuild.io/cilium-runtime:1.16.7-dd2-fips-3 | jq '.[].Config.Labels'
{
  "CILIUM_VERSION": "1.16.7",
  "CI_JOB_ID": "XXX",
  "CI_PIPELINE_ID": "XXX",
  "base_image_target": "prod",
  "baseimage.arch": "arm64",
  "baseimage.aws_uses_fips_endpoint_override": "yes",
  "baseimage.buildstamp": "2025-03-04T15:53:04Z",
  "baseimage.is_fedramp_high_compliant": "yes",
  "baseimage.isgbi": "yes",
  "baseimage.name": "images/base/gbi-ubuntu_2204-fips",
  "baseimage.os": "ubuntu jammy LTS FIPS",
  "org.opencontainers.image.ref.name": "ubuntu",
  "org.opencontainers.image.version": "22.04",
  "target": "prod"
}

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
Comment on lines +66 to +68
FROM scratch
LABEL maintainer="maintainer@cilium.io"
COPY --from=rootfs / /
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -79 to -81
# Datadog Modification: operator has to run as root
USER root

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HadrienPatte HadrienPatte merged commit 65e4833 into v1.16-dd Mar 7, 2025
28 of 50 checks passed
@HadrienPatte HadrienPatte deleted the hadrien/1.16/distroless-fips branch March 7, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants