Skip to content

Commit dc05d3a

Browse files
Manciukicroypat
authored andcommitted
fix(devctr): copy only poetry files during build
During the container build, all files in the devctr folder are copied into /tmp/poetry, including the Dockerfile itself. When rebuilding a Dockerfile, Docker is smart and only rebuilds the parts that changes, but since the Dockerfile itself is copied over, the build starts from scratch every time and doesn't reuse intermediate images from earlier builds. This is annoying when adding new things to the dev container as every attempt will incur in a long rebuild process. By copying only the files relevant to poetry, we allow Docker to only rebuild the commands that changed. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent d38123e commit dc05d3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/devctr/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ RUN apt-get update \
8989
&& pip3 install --upgrade poetry
9090

9191
ARG VENV="/opt/venv"
92-
COPY tools/devctr /tmp/poetry
92+
COPY tools/devctr/poetry.lock /tmp/poetry/
93+
COPY tools/devctr/pyproject.toml /tmp/poetry/
9394
RUN cd /tmp/poetry \
9495
&& virtualenv $VENV \
9596
&& . $VENV/bin/activate \

0 commit comments

Comments
 (0)