-
Notifications
You must be signed in to change notification settings - Fork 2
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 awareness/support for Containerfiles #3
Comments
Thanks for logging this improvement! From looking at the code we'd only have to change this matcher when starting out:
From the types of changes we're making here for now I think we're fine to treat Dockerfiles and Containerfiles as if they were the same. Once those diverge we can reevaluate, and indeed potentially rename or clone recipes as needed. It's well possible this will look different in the future if we are to add a proper parser. We'll likely want to make matching changes to our OSS plugins and Moderne CLI to parse Container files as plain text too.
Note how each of those use |
@timtebeek this was my thinking as well, and I was planning on submitting that (Along with unit tests which test that containerfile is recognized).
I'd think we'd want to find Containerfiles wherever we find Dockerfiles, so I'd say yes. I'll submit a PR for the simple change. |
* Add awareness/support for Containerfiles #3 * Use parameterized test; apply formatter --------- Co-authored-by: Jonathan Schneider <[email protected]> Co-authored-by: Tim te Beek <[email protected]>
What problem are you trying to solve?
Dockerfiles are the more popular container build manifest, but Containerfiles are also used with tools such as buildah and podman.
The rewrite-docker tool should be Containerfile-aware as well. As for whether the package needs renaming to be more inclusive of OCI containers (e.g. 'rewrite-container' or 'rewrite-container-images') can always be visited at a future time.
Describe the solution you'd like
Add Containerfile support in this project. Practically, whatever this can do to Dockerfiles, it can do to Containerfiles. We can either modify the filename recognition to recognize both names, or create two separate classes in the assumption that their specification/adherence may diverge.
The OCI specification is listed here: https://github.com/opencontainers/image-spec/blob/main/spec.md
Docker has a 2017 blog article around the earlier emergence of the spec: https://www.docker.com/blog/demystifying-open-container-initiative-oci-specifications/
Have you considered any alternatives or workarounds?
Additional context
Are you interested in contributing this feature to OpenRewrite?
I'm looking to contribute this change to OpenREwrite.
The text was updated successfully, but these errors were encountered: