{"id":16568978,"url":"https://github.com/thehale/docker-python-poetry","last_synced_at":"2025-03-16T20:31:07.313Z","repository":{"id":61218926,"uuid":"498485249","full_name":"thehale/docker-python-poetry","owner":"thehale","description":"Robust, lightweight, configurable python-poetry Docker images for any use case.","archived":false,"fork":false,"pushed_at":"2025-02-17T03:18:57.000Z","size":47,"stargazers_count":43,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T13:18:27.396Z","etag":null,"topics":["docker","python-poetry"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/thehale.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":"thehale","custom":"paypal.me/jhaledev"}},"created_at":"2022-05-31T20:18:53.000Z","updated_at":"2025-02-17T03:19:01.000Z","dependencies_parsed_at":"2024-01-10T03:26:20.770Z","dependency_job_id":"16dac852-adfe-48fe-96ea-9247859aabbe","html_url":"https://github.com/thehale/docker-python-poetry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehale%2Fdocker-python-poetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehale%2Fdocker-python-poetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehale%2Fdocker-python-poetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehale%2Fdocker-python-poetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thehale","download_url":"https://codeload.github.com/thehale/docker-python-poetry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"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","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","python-poetry"],"created_at":"2024-10-11T21:12:07.271Z","updated_at":"2025-03-16T20:31:06.872Z","avatar_url":"https://github.com/thehale.png","language":"Dockerfile","funding_links":["https://github.com/sponsors/thehale","paypal.me/jhaledev"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n Copyright (c) 2022 Joseph Hale\n\n This software is released under the MIT License.\n https://opensource.org/licenses/MIT\n--\u003e\n\n# [Python Poetry](https://github.com/python-poetry/poetry) in Docker\n\n\u003c!-- BADGES --\u003e\n\n[![](https://badgen.net/docker/pulls/thehale/python-poetry)](https://hub.docker.com/r/thehale/python-poetry)\n[![](https://badgen.net/github/license/thehale/docker-python-poetry)](https://github.com/thehale/docker-python-poetry/blob/master/LICENSE)\n[![](https://badgen.net/badge/icon/Sponsor/pink?icon=github\u0026label)](https://github.com/sponsors/thehale)\n[![Joseph Hale's software engineering blog](https://jhale.dev/badges/website.svg)](https://jhale.dev)\n[![](https://jhale.dev/badges/follow.svg)](https://www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS\u0026followMember=thehale)\n\nRobust, lightweight, configurable `python-poetry` Docker images for any use\ncase.\n\n_NOTE: This repository is **not** an official project from the creators of\nPython Poetry. Hopefully you find it useful anyway!_\n\n## Quickstart\n\nMost of the time, you will be using these images as a base image for your own\nDockerfiles (e.g. devcontainers, building Python applications, etc.)\n\n```Dockerfile\nFROM thehale/python-poetry\n\nRUN poetry --version\n# Your build steps here.\n```\n\nHowever, you can also download and run the latest `python-poetry` Docker image\nby pulling it from DockerHub.\n\n```\ndocker pull thehale/python-poetry\ndocker run --rm thehale/python-poetry poetry --version\n```\n\nThere are tagged images for all the latest stable versions of `python-poetry`\nfor all versions of Python that Poetry supports (\u003e3.7). You can see the [full\ntag list on DockerHub](https://hub.docker.com/r/thehale/python-poetry/tags).\n\n## Build Your Own Image\n\nThis repo automatically builds images for the latest stable versions of\n`python-poetry` for all supported versions of Python (\u003e3.7).\n\n- You can see the full build matrix in\n  [.github/workflows/docker-image.yml](https://github.com/thehale/docker-python-poetry/blob/master/.github/workflows/docker-image.yml)\n\nHowever, if you need a combination that isn't automatically built, you can\neasily create your own by modifying the command below to contain your preferred\nvalues for `POETRY_VERSION` and `PYTHON_IMAGE_TAG`:\n\n```bash\nmake build-version \\\n    POETRY_VERSION=\"1.1.13\" \\\n    PYTHON_IMAGE_TAG=\"3.10-slim\"\n```\n\n## Non-root User\n\n\u003e [!NOTE]\n\u003e\n\u003e This section was adapted from the Node.js docs for [**Non-root\n\u003e user**](https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user)\n\u003e in their Docker images.\n\n\nBy default, Docker runs commands inside the container as root which violates the [Principle of Least Privilege (PoLP)](https://en.wikipedia.org/wiki/Principle_of_least_privilege) when superuser permissions are not strictly required. You want to run the container as an unprivileged user whenever possible. The nonroot images provide the `nonroot` user for such purpose. The Docker Image can then be run with the `nonroot` user in the following way:\n\n```\n-u \"nonroot\"\n```\n\nAlternatively, the user can be activated in the `Dockerfile`:\n\n```Dockerfile\nFROM thehale/python-poetry:1.8.3\n...\n# At the end, set the user to use when running this image\nUSER nonroot\n```\n\n\u003e [!TIP] \n\u003e\n\u003e When using the `nonroot` user, remember to assign the corresponding ownership\n\u003e to your application tree (e.g. `chmod`).\n\nNote that the `nonroot` user is neither a build-time nor a run-time dependency\nand it can be removed or altered, as long as the functionality of the\napplication you want to add to the container does not depend on it.\n\nIf you do not want nor need the user created in this image, you can remove it with the following:\n\n```Dockerfile\n# For debian based images use:\nRUN userdel -r nonroot\n\n# For alpine based images use:\nRUN deluser --remove-home nonroot\n```\n\nIf you need to change the uid/gid of the user, you can use:\n\n```Dockerfile\nRUN groupmod -g 999 nonroot \u0026\u0026 usermod -u 999 -g 999 nonroot\n```\n\nIf you need another name for the user (ex. `myapp`), execute:\n\n```Dockerfile\nRUN usermod -d /home/myapp -l myapp nonroot\n```\n\nFor alpine based images, you do not have `groupmod` nor `usermod`, so to change the uid/gid you have to delete the previous user:\n\n```Dockerfile\nRUN deluser --remove-home nonroot \\\n  \u0026\u0026 addgroup -S nonroot -g 999 \\\n  \u0026\u0026 adduser -S -G nonroot -u 999 nonroot\n```\n\n## License\n\nThis project is licensed under the terms of the [MIT License](https://choosealicense.com/licenses/mit/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehale%2Fdocker-python-poetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthehale%2Fdocker-python-poetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehale%2Fdocker-python-poetry/lists"}