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

Add -dev variant to static image #368

Closed
wants to merge 1 commit into from

Conversation

charlieegan3
Copy link
Contributor

Plan is to replace gcr.io/distroless/static:debug here https://github.com/open-policy-agent/opa/blob/main/Makefile#L363

Fixes:

Related:

Pre-review Checklist

  • IMPORTANT: 'image-request' tag has been applied if this PR is adding any images, including new versions or variants

For new image PRs only

If you have an apko.yaml file in this PR you need to follow this checklist, otherwise feel free to remove.

  • Image is marked experimental or stable as appropriate
  • The last two minor versions are available
  • The latest tag points to the newest stable version
  • There is a dev tag available that includes a shell and apk tools (by depending on 'wolfi-base')
  • The image runs as nonroot and GID/UID are set to 65532
    • Alternatively the username and GID/UID may be a commonly used one from the ecosystem e.g: postgres
    • See above for exceptions to nonroot rule
  • ENTRYPOINT
    • For applications/servers/utilities call main program with no arguments e.g. [redis-server]
    • For base images leave empty
    • For dev variants set to entrypoint script that falls back to system
  • CMD:
    • For server applications give arguments to start in daemon mode (may be empty)
    • For utilities/tooling bring up help e.g. –help
    • For base images with a shell, call it e.g. [/bin/sh]
  • Consider where and how the image deviates from popular alternatives. Is there a good reason and is it documented?
  • Add annotations e.g:
annotations:
  "org.opencontainers.image.authors": "Chainguard Team https://www.chainguard.dev/"
  "org.opencontainers.image.url": https://edu.chainguard.dev/chainguard/chainguard-images/reference/busybox/ # use the academy site here
  "org.opencontainers.image.source": https://github.com/chainguard-images/images/tree/main/images/bazel # use github here
  • Check if environment variables are needed e.g. to set data locations
  • Ensure the image responds to SIGTERM
    • docker kill $(docker run -d --rm cgr.dev/chainguard/nginx)
  • Documentation. Let's make this excellent. Include usage example.
  • Error logs write to stderr and normal logs to stdout. DO NOT write to file.
  • Include tests, at the very least a basic smoke test.

Plan is to replace `gcr.io/distroless/static:debug` here
https://github.com/open-policy-agent/opa/blob/main/Makefile#L363

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@charlieegan3 charlieegan3 requested a review from a team as a code owner March 21, 2023 14:55
@charlieegan3 charlieegan3 requested review from cpanato and removed request for a team March 21, 2023 14:55
@charlieegan3
Copy link
Contributor Author

IMPORTANT: 'image-request' tag has been applied if this PR is adding any images, including new versions or variants

I don't think that I can set the labels, so might need some help there.

Comment on lines 8 to 9
- apko:
config: configs/latest-glibc.apko.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

if we could would be great to have this on the glibc version too

@imjasonh
Copy link
Member

imjasonh commented Mar 21, 2023

I might be missing some context, but what is a dev variant of static supposed to achieve? As I understand it, static:latest-dev would be identical to static:latest with the PR in its current state. Typically dev variants have other stuff in them to make them useful to developers. edit: I was wrong! But keep reading anyway. :)

The nearest equivalent to gcr.io/distroless/static:debug would probably be something like cgr.dev/chainguard/busybox, which has no package manager, only a shell. If you want a package manager, you can use wolfi-base, which has busybox and apk.

So :static-dev being "static but with a shell and apk" is basically exactly what we have today in wolfi-base. I'd prefer to just recommend that image instead of having a separate "static-but-not-exactly" image that's ~equivalent to an existing image.

@patflynn patflynn added the image-request tag for new chainguard image requests label Mar 21, 2023
@charlieegan3
Copy link
Contributor Author

Thanks for those details Jason, much appreciated. I think that we can use busybox in that case. I'll close this for now!

@charlieegan3 charlieegan3 deleted the static-dev branch March 22, 2023 10:28
charlieegan3 added a commit to open-policy-agent/opa that referenced this pull request Mar 23, 2023
This completes the work started in #5540

Fixes #5544

We can't use distroless since they don't have a nossl cc image: GoogleContainerTools/distroless#1210

Chainguard have added this (-dev rather than :debug) to their image collection: chainguard-images/images#187

Following advice here, using their busybox is the best replacement for `gcr.io/distroless/static:debug` chainguard-images/images#368 (comment)

Signed-off-by: Charlie Egan <charlie@styra.com>
developer-guy pushed a commit to Dentrax/images that referenced this pull request Feb 12, 2024
Co-authored-by: imjasonh <imjasonh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
image-request tag for new chainguard image requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants