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

Documentation for how to use with Docker #241

Closed
mitsuhiko opened this issue May 29, 2023 · 2 comments · Fixed by #906
Closed

Documentation for how to use with Docker #241

mitsuhiko opened this issue May 29, 2023 · 2 comments · Fixed by #906
Labels
documentation Improvements or additions to documentation

Comments

@mitsuhiko
Copy link
Collaborator

While there is no perfect docker / deployment story for rye yet, at the very least how to use the current lockfiles with pip should be documented. Refs #239

@mitsuhiko mitsuhiko added the documentation Improvements or additions to documentation label May 29, 2023
@0ptimista
Copy link

Recently I am facing the same problem, and according some look up at #239 I have had my problem solved in a workaround:

FROM python:3.11.0-slim-bullseye AS builder

WORKDIR /company/project

COPY ./requirements.lock /company/project
COPY ./pyproject.toml /company/project
COPY ./src/ /company/project/src

RUN python -m pip install --no-cache-dir --upgrade pip

RUN sed '/-e/d' requirements.lock > requirements.txt
RUN sed -i 's/requires = \["hatchling"\]/requires = \["setuptools", "setuptools-scm"\]/; s/build-backend = "hatchling.build"/build-backend = "setuptools.build_meta"/' pyproject.toml
RUN sed -i '/\[tool\.hatch\.metadata\]/d; /allow-direct-references = true/d' pyproject.toml

RUN pip install --upgrade setuptools
RUN pip install -r requirements.txt

RUN pip install .

CMD ["python3", "./src/project/main.py"]

I dont't know why useing hatching build (rye default) with pip install . would fail, so I replace it with setuptools according to it's docs and pip install . works.

@konstin
Copy link
Member

konstin commented Mar 19, 2024

Trying to install it with the default installer in docker fails with an unhelpful error message:

FROM ubuntu
RUN apt update && apt install -yy curl
RUN curl -sSf https://rye-up.com/get | bash
3.861 Welcome to Rye!
3.861 
3.861 This installer will install rye to /root/.rye
3.861 This path can be changed by exporting the RYE_HOME environment variable.
3.861 
3.861 Details:
3.861   Rye Version: 0.29.0
3.861   Platform: linux (x86_64)
3.861 
3.861 error: IO error: not a terminal
3.861 
3.861 Caused by:
3.861     not a terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants