package parsing docker files
Project description
Docker parser
Docker attempts to simplify machine processing of dockerfiles. This moduel is not intended to extend docker SDK or build images, instead it attempts to parse instructions into simply manipulatable python objects, deduce state of environment in which commands are executed and allow modification of resulting dockerfile.
Instalation
pip3 install docker-parser
Usage
Print all executed RUN commands
from docker_parser import parser
with open("dockerfile") as src:
dockerfile = parser.Parser.loads(src.read())
for cmd in dockerfile.run():
print(cmd.arg)
dockerfile:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y gcc make
COPY ./src /var/tmp/
WORKDIR /var/tmp/src
RUN make
output:
apt update
apt install -y gcc make
make
for more examples refer to examples
Contributing
To contribute:
- Increment version in pyproject.toml
- Create merge request to
preprodbranch - Once your changes are reviewed and merged, pipeline publishes new version to testpypi
- After verifying that changes don't break rest of the code and don't justify major release, changes will be pushed to
mainbranch and pushed to production pypi
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_parser-0.0.8.tar.gz.
File metadata
- Download URL: docker_parser-0.0.8.tar.gz
- Upload date:
- Size: 10.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d255b006dd7993cf76944b73bd9042bf6d5e9b9bd56ac94a6630ea715a4542
|
|
| MD5 |
711dc6c4c34276183a83994e16d59bde
|
|
| BLAKE2b-256 |
79eb19bf3f21d186a2f46e483fb647b6d7c02e3d8008898e037494061aa71425
|
File details
Details for the file docker_parser-0.0.8-py3-none-any.whl.
File metadata
- Download URL: docker_parser-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a53330e1dedf38a2fd7bdde50a905b03b121bc6f6c7fefb77d38c1e273c58f38
|
|
| MD5 |
3358b21a817f9e33fe8cfbc173d2653d
|
|
| BLAKE2b-256 |
7b9182feb2f4f7536ae9f604daeb25f802440315d14ede9209b018ccad642081
|