You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently changed my Dockerfile to use multi-stage builds.
I thought PDM would be perfect because of it's use of a __pypackage__ directory.
When building a docker image, you want the layers in order from least to most susceptible to change.
In that way, we want to install dependencies before the code as to not reinstall them every time the code change.
However, it is not possible right now with PDM.
Example:
FROM python AS builder
WORKDIR /
RUN pip install pdm
COPY pdm.lock
pdm install --only-dependencies # <-- this flag does not exist in PDM 1.5.2
FROM python
ENV PYTHONPATH=src:packages
COPY --from=builder /__pypackage__/3.9/lib packages
COPY src src
ENTRYPOINT ["python", "src/main.py"]
Describe the solution you'd like
Poetry has a --no-root option when installing that has this behavior.
By default, the above command will also install the current project. To install only the
dependencies and not including the current project, run the command with the
--no-root option like below:
poetry install --no-root
I think adding a similar flag to pdm install would be best.
Although, I find that name confusing and would prefer something like --only-dependencies, but I don't really mind, as long as such an option exists.
The text was updated successfully, but these errors were encountered:
I recently changed my Dockerfile to use multi-stage builds.
I thought PDM would be perfect because of it's use of a __pypackage__ directory.
When building a docker image, you want the layers in order from least to most susceptible to change.
In that way, we want to install dependencies before the code as to not reinstall them every time the code change.
However, it is not possible right now with PDM.
Example:
Describe the solution you'd like
Poetry has a
--no-root
option when installing that has this behavior.I think adding a similar flag to
pdm install
would be best.Although, I find that name confusing and would prefer something like
--only-dependencies
, but I don't really mind, as long as such an option exists.The text was updated successfully, but these errors were encountered: