Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Alpine images #27

Open
Angelin01 opened this issue Dec 1, 2022 · 1 comment
Open

Support for Alpine images #27

Angelin01 opened this issue Dec 1, 2022 · 1 comment

Comments

@Angelin01
Copy link

Angelin01 commented Dec 1, 2022

Alpine images are extremely common due to their small size.

For example, Python's 3.7.15-alpine3.17 image is 17.35MiB compressed while the 3.7.15-slim Ubuntu based one is 44.89MiB

As a side note, a Dockerfile as simple as this seems to work:

FROM python:3.10.8-alpine3.17 as build

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONFAULTHANDLER=1 \
    POETRY_VERSION=1.2.2 \
    POETRY_VIRTUALENVS_IN_PROJECT=true \
    POETRY_NO_INTERACTION=1 \
    POETRY_HOME=/usr/bin/poetry \
    PATH=/usr/bin/poetry/bin:$PATH

RUN wget -O- https://install.python-poetry.org | python

ENTRYPOINT ["poetry"]
@mateusoliveira43
Copy link
Owner

Thanks for the issue, Angelo!

I did not added Alpine suppprt because Python's performance are worse in them (some source).

But I see no problem on adding it to the image! I am a little busy until the end of the year, so I do not know when I can implement this feature. But if you want to do it yourself, it would be awesome!

Unfortunately I still have not written a contribution guide lines for the project, but the idea seems to be

  • add Dockerfile-alpine.template file to the templates folder (very similar to the Dockerfile of your example).
  • add -alpine to config.py
  • assure the quality of code, from the project's CI (you can use Poetry, with poetry install && poetry shell, or pure pip, with pip install -r requirements/dev.txt && pip install -e ., to install the quality tools and run them locally).

Any question, you can ask me!

@mateusoliveira43 mateusoliveira43 pinned this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants