dockerfile-parse
Python library for Dockerfile manipulation
Decision gist · record as of 2026-08-14
Yes, if you need to parse or modify Dockerfiles in Python code. Low install friction, no dependencies, and stable API make it a straightforward choice for build tooling. Dormant maintenance is acceptable for a mature, narrow-scope library, but verify that its parser handles your target Dockerfile syntax before committing to it in a critical pipeline.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is dormant—last release was 2023-07-18 and no commits since 2024-08-12—but the package is marked Production/Stable and has been in use since 2015, so it is unlikely to require active development.
License · maintenance · safety
BSD (permissive) — BSD license is permissive, allowing commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
last release 2023-07-18 (1123 days) · last repo commit 2024-08-12 · 142 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 11,634,782 downloads/mo, #1,375 on PyPI
Alternatives
Verify before relying
pip install dockerfile-parse
from dockerfile_parse import DockerfileParser
dfp = DockerfileParser()
dfp.content = "FROM base\nLABEL foo=\"bar\"\nUSER me"
print(dfp.baseimage)
dfp.baseimage = 'centos:7'
print(dfp.content)- Whether the parser handles all Dockerfile syntax variations and edge cases introduced in recent Docker versions
- Whether dormant maintenance poses a risk if Docker's Dockerfile format evolves significantly
What it is and what it does
dockerfile-parse is a Python library that reads and parses Dockerfile files into a structured representation, exposing properties like base image, labels, and user directives for programmatic inspection and modification. It has no runtime dependencies and supports Python 3.6 through 3.11, making it lightweight to integrate into build tooling, container orchestration systems, or CI/CD pipelines that need to reason about or rewrite Dockerfiles.
The library is in Production/Stable status and has been maintained since 2015, though recent activity is minimal. It is suitable for tasks like extracting metadata from Dockerfiles, validating structure, or generating modified versions with updated base images or labels. The permissive BSD license allows use in both open and closed projects.
Use it for
- Extract base image, labels, and user directives from existing Dockerfiles for inventory or compliance auditing
- Programmatically update a Dockerfile's base image across a fleet of build configurations
- Validate Dockerfile structure and syntax before passing it to a build system
- Generate or transform Dockerfiles in build automation tools that need to inject environment variables or change layers
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to parse or modify Dockerfiles in Python code.
Low install friction, no dependencies, and stable API make it a straightforward choice for build tooling. Dormant maintenance is acceptable for a mature, narrow-scope library, but verify that its parser handles your target Dockerfile syntax before committing to it in a critical pipeline.
Install
dockerfile-parse on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-07-18 and no commits since 2024-08-12—but the package is marked Production/Stable and has been in use since 2015, so it is unlikely to require active development.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
Quickstart
pip install dockerfile-parse
from dockerfile_parse import DockerfileParser
dfp = DockerfileParser()
dfp.content = "FROM base\nLABEL foo=\"bar\"\nUSER me"
print(dfp.baseimage)
dfp.baseimage = 'centos:7'
print(dfp.content)
Verify before relying
- Whether the parser handles all Dockerfile syntax variations and edge cases introduced in recent Docker versions
- Whether dormant maintenance poses a risk if Docker's Dockerfile format evolves significantly
Package facts
| License | BSD permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,634,782 / month, #1,375 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: dockerfile_parse-2.0.1-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dockerfile parsing”
- dockerfile-parseParses and manipulates Dockerfile files programmatically, allowing…
- dockerfileParses Dockerfile syntax into structured Python objects using the…
- container-inspectorAnalyzes Docker images, containers, and virtual machine images to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also dockerfile · INITools · plyara · rosdistro · tox-docker · hadolint-coatl · parver · aspy.refactor-imports · dom-toml · omegaconf