Python library for Dockerfile manipulation
Project Links
Meta
Author: Jiri Popelka
Requires Python: >=3.6
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Other Environment
Intended Audience
- Developers
License
- OSI Approved :: BSD License
Operating System
- OS Independent
Programming Language
- Python
- Python :: 3
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: Implementation :: CPython
Topic
- Software Development :: Libraries :: Python Modules
dockerfile-parse
Python library for parsing Dockerfile files.
Installation
From PyPI
pip install dockerfile-parse
From git
Clone this git repo and install using the python installer
git clone https://github.com/containerbuildsystem/dockerfile-parse.git
cd dockerfile-parse
sudo pip install .
Usage
from pprint import pprint
from dockerfile_parse import DockerfileParser
dfp = DockerfileParser()
dfp.content = """\
From base
LABEL foo="bar baz"
USER me"""
# Print the parsed structure:
pprint(dfp.structure)
pprint(dfp.json)
pprint(dfp.labels)
# Set a new base:
dfp.baseimage = 'centos:7'
# Print the new Dockerfile with an updated FROM line:
print(dfp.content)
2.0.1
Jul 18, 2023
2.0.0
Dec 13, 2022
1.2.0
Jun 09, 2021
1.1.0
Nov 06, 2020
1.0.0
Jul 03, 2020
0.0.18
Jun 02, 2020
0.0.17
Apr 30, 2020
0.0.16
Jan 21, 2020
0.0.15
Jul 15, 2019
0.0.14
Apr 26, 2019
0.0.13
Nov 14, 2018
0.0.11
Jul 12, 2018
0.0.10
Apr 17, 2018
0.0.7
May 23, 2017
0.0.6
Jan 19, 2017
0.0.5
Sep 21, 2015
0.0.4
Aug 27, 2015
0.0.3
Jun 26, 2015
Wheel compatibility matrix
Files in release
No dependencies