I'm new to Docker, so apologies for this poor question.
I'm using an M1 Mac, and my dockerfile looks like this:
FROM python:3.8.1-slim
ENV PYTHONUNBUFFERED 1
EXPOSE 8000
WORKDIR /app
COPY ./requirements.txt .
COPY ./src .
RUN pip install --verbose -r requirements.txt
CMD ["uvicorn", "--host", "0.0.0.0", "--port", "8000", "src.main:app"]
When I run docker build -t project .
I get an error message that includes
Cargo, the Rust package manager, is not installed or is not on PATH.
I've tried adding cargo and rust to requirements.txt and playing with ENV PATH
to no avail; which cargo
on the host machine returns
/opt/homebrew/bin/cargo
Can someone please point me in the right direction?
Edit: I don't know why Rust is required here, but it seems like it isn't uncommon... this is where it shows up in the error:
Running command /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpfzj95ykv
Checking for Rust toolchain....
Edit 2: I reduced the number of packages in requirements.txt and that seems to have fixed it for now. Still annoyed I can't tell from the error what the issue is, and curious what the fix would be...