rye icon indicating copy to clipboard operation
rye copied to clipboard

add way for install rye in the docker

Open ZeN220 opened this issue 10 months ago • 4 comments

in documentation section about docker Container from a Python Package written:

If your code is an installable package, it's recommended that you first build it, then install it inside your Docker image. This way you can be sure that the image is exactly the same as what a user installation would be.

its wrong. build stage should not be separated to the build wheels and build docker image. build wheels should take place in build docker image. i have not found a way to install rye in the docker, so i believe this functionallity should be added

ZeN220 avatar Apr 10 '24 19:04 ZeN220

I've used this in some builds to install rye, maybe it can be of help to achieve what you want:

ENV PATH=/root/.rye/shims:$PATH
RUN curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash

stefur avatar Apr 15 '24 11:04 stefur

I've used this in some builds to install rye, maybe it can be of help to achieve what you want:

ENV PATH=/root/.rye/shims:$PATH
RUN curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash

yea, its work, but i believe its a workaround. default python image (such as -slim, -buster, .etc) doesnt have a curl. therefore for install rye you also should update packages which takes up a significant time. i think need to do more simply install way (for ex. like a poetry with install from pip)

ZeN220 avatar Apr 15 '24 21:04 ZeN220

Honestly, the best way to install in docker would be a published multi-platform docker image with rye inside. Then you can do a multi-stage step to copy it to your image, and note that both rye and your base image run in parallel this way, without requiring curl or the install script which mostly tries to find the right URL to download from, based on your platform.

helderco avatar Apr 16 '24 22:04 helderco

rye build is just a build frontend. How about using build instead of Rye in containers?

python -m pip install build
python -m build

MtkN1 avatar Apr 19 '24 13:04 MtkN1