Skip to main content

dockerfile-parse

unittests status badge coveralls status badge lgtm python badge lgtm alerts badge linters status badge

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)

Release files for dockerfile-parse 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dockerfile-parse 2.0.1
File Size Uploaded
dockerfile-parse-2.0.1.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dockerfile-parse 2.0.1
File Interpreter ABI Platform
dockerfile_parse-2.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 39.4 kB

Release files / dockerfile-parse-2.0.1.tar.gz

Download URL dockerfile-parse-2.0.1.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3184ccdc513221983e503ac00e1aa504a2aa8f84e5de673c46b0b6eee99ec7bc
BLAKE2b-256 checksum
How to use checksums
92df929ee0b5d2c8bd8d713c45e71b94ab57c7e11e322130724d54f469b2cd48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / dockerfile_parse-2.0.1-py2.py3-none-any.whl

Download URL dockerfile_parse-2.0.1-py2.py3-none-any.whl
Size 14.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bdffd126d2eb26acf1066acb54cb2e336682e1d72b974a40894fac76a4df17f6
BLAKE2b-256 checksum
How to use checksums
7a6c79cd5bc1b880d8c1a9a5550aa8dacd57353fa3bb2457227e1fb47383eb49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.17

3 release files

0.0.16

1 release file

0.0.15

1 release file

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page