Skip to content

jimschubert/rewrite-docker

Repository files navigation

Rewrite-Docker

License Java Version Build

A library that extends OpenRewrite to provide Dockerfile parsing, analysis, and transformation capabilities.

Project Status

⚠️ Work in Progress ⚠️

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.

Overview

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.

Features

  • Dockerfile AST (Abstract Syntax Tree) parsing
  • Tree representation of Dockerfile instructions
  • Visitor pattern for navigating and transforming Dockerfiles

Getting Started

Prerequisites

  • Java 17 or higher
  • Gradle

Installation

The library is available via JitPack and can be added to your project as a dependency.

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.jimschubert:rewrite-docker:1.0.4'
}

Maven

<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>

Building

To build the project, you can use Gradle. Make sure you have Java 17 or higher installed.

./gradlew :spotlessApply build

Usage Examples

Coming soon

Development Roadmap

  • Add parser error handling for invalid syntaxes
  • Develop common Dockerfile recipes
  • Add documentation and usage examples

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License, Version 2.0.

About

A pet project for playing around with Docker parsing in OpenRewrite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages