{"id":24665613,"url":"https://github.com/asottile-archive/dockerfile","last_synced_at":"2026-01-15T01:46:51.015Z","repository":{"id":16754497,"uuid":"80555589","full_name":"asottile-archive/dockerfile","owner":"asottile-archive","description":"Parse a dockerfile into a high-level representation using the official go parser","archived":true,"fork":false,"pushed_at":"2025-01-20T20:39:11.000Z","size":266,"stargazers_count":104,"open_issues_count":0,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-30T03:51:48.522Z","etag":null,"topics":["docker","dockerfile","python"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asottile-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"asottile"}},"created_at":"2017-01-31T19:47:25.000Z","updated_at":"2025-08-16T23:07:56.000Z","dependencies_parsed_at":"2023-01-13T19:00:26.855Z","dependency_job_id":"4185bb48-4768-484e-9ad0-2effea91a6d6","html_url":"https://github.com/asottile-archive/dockerfile","commit_stats":{"total_commits":216,"total_committers":4,"mean_commits":54.0,"dds":0.4444444444444444,"last_synced_commit":"cf355440518eef065cdefdfc49c9b25113e45718"},"previous_names":["asottile-archive/dockerfile"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/asottile-archive/dockerfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile-archive%2Fdockerfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile-archive%2Fdockerfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile-archive%2Fdockerfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile-archive%2Fdockerfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asottile-archive","download_url":"https://codeload.github.com/asottile-archive/dockerfile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asottile-archive%2Fdockerfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockerfile","python"],"created_at":"2025-01-26T07:04:28.526Z","updated_at":"2026-01-15T01:46:50.973Z","avatar_url":"https://github.com/asottile-archive.png","language":"Go","funding_links":["https://github.com/sponsors/asottile"],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nit turns out multiple go shared objects in a single process is not supported\n\nit likely broke in [go 1.21] and there is no intention to fix it :(\n\n[go 1.21]: https://github.com/golang/go/issues/65050#issue-2074509727\n\n___\n\n[![build status](https://github.com/asottile/dockerfile/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/dockerfile/actions/workflows/main.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/dockerfile/main.svg)](https://results.pre-commit.ci/latest/github/asottile/dockerfile/main)\n\ndockerfile\n==========\n\nThe goal of this repository is to provide a wrapper around\n[docker/docker](https://github.com/docker/docker)'s parser for dockerfiles.\n\n\n## python library\n\n### Installation\n\nThis project uses [setuptools-golang](https://github.com/asottile/setuptools-golang)\nwhen built from source.  To build from source you'll need a go compiler.\n\nIf you're using linux and sufficiently new pip (\u003e=8.1) you should be able to\njust download prebuilt manylinux1 wheels.\n\n```\npip install dockerfile\n```\n\n### Usage\n\nThere's three api functions provided by this library:\n\n#### `dockerfile.all_cmds()`\n\nList all of the known dockerfile cmds.\n\n```python\n\u003e\u003e\u003e dockerfile.all_cmds()\n('add', 'arg', 'cmd', 'copy', 'entrypoint', 'env', 'expose', 'from', 'healthcheck', 'label', 'maintainer', 'onbuild', 'run', 'shell', 'stopsignal', 'user', 'volume', 'workdir')\n```\n\n#### `dockerfile.parse_file(filename)`\n\nParse a Dockerfile by filename.\nReturns a `tuple` of `dockerfile.Command` objects representing each layer of\nthe Dockerfile.\nPossible exceptions:\n- `dockerfile.GoIOError`: The file could not be opened.\n- `dockerfile.GoParseError`: The Dockerfile was not parseable.\n\n```python\n\u003e\u003e\u003e pprint.pprint(dockerfile.parse_file('testfiles/Dockerfile.ok'))\n(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),\n Command(cmd='cmd', sub_cmd=None, json=True, original='CMD [\"echo\", \"hi\"]', start_line=2, flags=(), value=('echo', 'hi')))\n```\n\n#### `dockerfile.parse_string(s)`\n\nParse a dockerfile using a string.\nReturns a `tuple` of `dockerfile.Command` objects representing each layer of\nthe Dockerfile.\nPossible exceptions:\n- `dockerfile.GoParseError`: The Dockerfile was not parseable.\n\n```python\n\u003e\u003e\u003e dockerfile.parse_string('FROM ubuntu:xenial')\n(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),)\n```\n\n## go library\n\nSlightly more convenient than the api provided by docker/docker?  Might not be\nterribly useful -- the main point of this repository was a python wrapper.\n\n### Installation\n\n```\ngo get github.com/asottile/dockerfile\n```\n\n### Usage\n\n[godoc](https://godoc.org/github.com/asottile/dockerfile)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasottile-archive%2Fdockerfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasottile-archive%2Fdockerfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasottile-archive%2Fdockerfile/lists"}