{"id":30700588,"url":"https://github.com/cupofpython/ai-converter","last_synced_at":"2025-09-02T12:07:46.446Z","repository":{"id":311638858,"uuid":"1040357464","full_name":"cupofpython/ai-converter","owner":"cupofpython","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-25T16:23:46.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T18:25:26.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cupofpython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-08-18T21:15:29.000Z","updated_at":"2025-08-25T16:23:50.000Z","dependencies_parsed_at":"2025-08-25T18:25:38.933Z","dependency_job_id":null,"html_url":"https://github.com/cupofpython/ai-converter","commit_stats":null,"previous_names":["cupofpython/ai-converter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cupofpython/ai-converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupofpython%2Fai-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupofpython%2Fai-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupofpython%2Fai-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupofpython%2Fai-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cupofpython","download_url":"https://codeload.github.com/cupofpython/ai-converter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupofpython%2Fai-converter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273280465,"owners_count":25077360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-02T12:07:43.765Z","updated_at":"2025-09-02T12:07:46.427Z","avatar_url":"https://github.com/cupofpython.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerfile Converter with AI\n\nThis CLI tool uses RAG on an Ollama model running in the Chainguard Ollama container to convert a Dockerfile to use equivalent Chainguard base images. It detects the base image in the dockerfile, scrapes for the appropriate docs on `images.chainguard.dev`, creates a new embedding, builds a vectorstore and chain, then produces a result. One container runs the CLI, and one runs the Ollama model.\n\n*Tools*\n- langchain\n- Python\n- Beautiful Soup\n- Ollama\n- Docker Compose\n- Chainguard\n\n## How to Use\n\n1. Run `docker compose up --build`\n1. For ease of use, put the Dockerfile(s) you want to convert in the same directory as this project\n1. Ensure Ollama container is up and running. If model doesn't pull, exec into the ollama container `docker exec -it ai-converter-ollama-1 bash` and run `ollama pull llama3.2`.\n1. In a separate terminal, run `docker exec -it ai-converter-dockerfile-converter-1 python rag_ollama_chainguard.py`\n1. Provide the Dockerfile name, or to exit, type `exit` to quit.\n\n\n### CLI Output Example\n```\n% docker exec -it rag-playground-dockerfile-converter-1 python rag_ollama_chainguard.py\n\nUSER_AGENT environment variable not set, consider setting it to identify your requests.\nChainguard Images Dockerfile Converter CLI\nType the path to a Dockerfile to convert, or 'exit' to quit.\n\nEnter Dockerfile path: Dockerfile.backend.test\nDetected base images in Dockerfile: ['python']\nFetching documentation for: ['https://images.chainguard.dev/directory/image/python/overview', 'https://images.chainguard.dev/directory/image/python/usage', 'https://images.chainguard.dev/directory/image/python/versions', 'https://images.chainguard.dev/directory/image/python/tags', 'https://images.chainguard.dev/directory/image/python/vuln']\n\nConverting Dockerfile...\n\n--- Conversion Result ---\nTo convert the provided Dockerfile to use Chainguard base images, I'll follow the instructions and recommendations from the Chainguard documentation.\n\nSince there are two available image variants (latest-dev and minimal runtime), I will assume that we want to create a multi-stage build. The latest-dev variant includes pip, uv, and apk package managers, as well as bash, ash, and sh shells. However, for security reasons, the minimal runtime variant removes these tools.\n\n... dockerfile here\n\n```\n\n### Notes from the Author\nThis is using AI and is non-deterministic, meaning YMMV in results. Please feel free to open a PR to adjust the prompting to make this application stronger!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcupofpython%2Fai-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcupofpython%2Fai-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcupofpython%2Fai-converter/lists"}