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.17.tar.gz (21.2 kB view details)

Uploaded Source

Built Distributions

dockerfile_parse-0.0.17-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

dockerfile_parse-0.0.17-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: dockerfile-parse-0.0.17.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for dockerfile-parse-0.0.17.tar.gz
Algorithm Hash digest
SHA256 a69d4ed44c4a890c16437327009ae59ec3a3afeb1abc3819d0c1b14a46099220
MD5 5e143d0b9f0506663eacdac5e3ce9132
BLAKE2b-256 b70efbae2d139e7e64590430029faee164d39decbe36b57148e61b0d7aa34f88

See more details on using hashes here.

File details

Details for the file dockerfile_parse-0.0.17-py3-none-any.whl.

File metadata

  • Download URL: dockerfile_parse-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for dockerfile_parse-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 868a6a00db2150ae92af177757eb35210f54243f6d8b2c362fe777e44fc98279
MD5 914b68871e42b337c915f1239f195a6d
BLAKE2b-256 a43eda91452dc2c45787d4b1e8566dc6095c117bcde1ad0292c978956a796a04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dockerfile_parse-0.0.17-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for dockerfile_parse-0.0.17-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7b8ab184c24ab35c2a0af47b1766dfeeeb7f47da42197ee9756aa4695c60c775
MD5 042084759cfdb877e1c4e61384a566e4
BLAKE2b-256 d30d650e77c15ba4975e203d6f26a6ce16cb72d935541f09a0188fa6e62ce621

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