Skip to main content

Python library for Dockerfile manipulation

Project description

dockerfile-parse

build status coverage status

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dockerfile-parse-0.0.18.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

dockerfile_parse-0.0.18-py2.py3-none-any.whl (13.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dockerfile-parse-0.0.18.tar.gz.

File metadata

  • Download URL: dockerfile-parse-0.0.18.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for dockerfile-parse-0.0.18.tar.gz
Algorithm Hash digest
SHA256 a09eae6871b7b314f8a8bddb67b6c5002708b22247511906cf2a9a45564b83db
MD5 ec1955780d2b63ebc774df616bb95267
BLAKE2b-256 3882d49b223bb025130b5903b2690b62e473dc1f94ae9b1508cbdc33bd26f550

See more details on using hashes here.

File details

Details for the file dockerfile_parse-0.0.18-py2.py3-none-any.whl.

File metadata

  • Download URL: dockerfile_parse-0.0.18-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for dockerfile_parse-0.0.18-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 181503bb5fe51e4384b17c8e787701d437ea0c058a689ceb8f1f47569ae5610d
MD5 a399c2046019f93814f7d2859624ea83
BLAKE2b-256 37674e3d305170005772615aea2fb7dafd046339e955bc07cd9d0228e950feb7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page