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 dockerfile-parse using 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.15.tar.gz (20.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: dockerfile-parse-0.0.15.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for dockerfile-parse-0.0.15.tar.gz
Algorithm Hash digest
SHA256 d5e5ab161aa9801bb6065e4ad344c143e677a01bdb0bd9b1999e0cc460d005e8
MD5 b110784ddd7b1e9f2e92d537c8f9daa9
BLAKE2b-256 e671d7fdac83725d543102e2d635a949a83ce1f29a4a5b689889a4230c515006

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