Skip to content

Author

Lianghao Li

1 paper indexed here

We haven’t gathered this author’s papers yet. Follow them and we’ll fetch their work.

Not the right person? Other researchers publish under this name.

Conference Jul 2026

KG-Augmented LLM for Efficient and Correct Dockerfile Generation

Container images are fundamental to cloud deployment, with their build instructions (e.g., Dockerfiles) critically impacting the efficiency and stability of cloud service. Manually authoring these instructions is error-prone, while Large Language Models (LLMs) lack the domain knowledge to generate both correct and optimized Dockerfiles reliably. This problem may cause runtime failures, prolonged deployment times and increased storage overhead. This paper introduces a novel knowledgeenhanced approach to automate Dockerfile generation. First, we construct a Dockerfile Instructions Knowledge Graph (DIKG) by analyzing a large corpus, capturing complex dependencies among images, packages, and commands. Leveraging DIKG, we design DKRAG, a retrieval-augmented generation system that guides an LLM to interpret user requirements and produce semantically accurate instructions. The output is further optimized via log-based repair and static dependency-aware refactoring for correctness, layer sharing, and minimal image size. Comprehensive experiments show our approach significantly improves the generation accuracy while also reducing build time and storage overhead compared to state-of-the-art methods.

Kun Wang, Yao Wu, Hao Fan et al. · 0 citations