A library that extends OpenRewrite to provide Dockerfile parsing, analysis, and transformation capabilities.
This is a pet project currently under development. It does not work well enough for production use yet. There is no guarantee that it will be completed or maintained long-term.
Rewrite-Docker aims to bring the power of OpenRewrite's AST-based transformation to Dockerfiles. This enables programmatic analysis and refactoring of Docker configuration files.
- Dockerfile AST (Abstract Syntax Tree) parsing
- Tree representation of Dockerfile instructions
- Visitor pattern for navigating and transforming Dockerfiles
- Java 17 or higher
- Gradle
The library is available via JitPack and can be added to your project as a dependency.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.jimschubert:rewrite-docker:1.0.4'
}<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.jimschubert</groupId>
<artifactId>rewrite-docker</artifactId>
<version>1.0.4</version>
</dependency>To build the project, you can use Gradle. Make sure you have Java 17 or higher installed.
./gradlew :spotlessApply buildComing soon
- Add parser error handling for invalid syntaxes
- Develop common Dockerfile recipes
- Add documentation and usage examples
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License, Version 2.0.