From 47a8c90ea6304c59a70d4d59666ef5e2378c764a Mon Sep 17 00:00:00 2001 From: Diego Ferigo Date: Fri, 8 Nov 2024 17:17:40 +0100 Subject: [PATCH] Update Dockerfile --- .devcontainer/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 776e0bd29..66eb5dcdb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -14,12 +14,10 @@ RUN apt-get update &&\ rm -rf /var/lib/apt/lists/* # Create the pixi environment. -COPY . /$PROJECT_NAME -WORKDIR /$PROJECT_NAME -RUN cd /$PROJECT_NAME &&\ +COPY . /workspaces/$PROJECT_NAME +RUN cd /workspaces/$PROJECT_NAME &&\ git lfs pull &&\ pixi install --environment $PIXI_ENVIRONMENT &&\ - echo "ln -s /pixi /$PROJECT_NAME/.pixi" >> /shell-hook.sh &&\ pixi shell-hook --environment $PIXI_ENVIRONMENT >> /shell-hook.sh &&\ echo 'exec "$@"' >> /shell-hook.sh &&\ chmod +x /shell-hook.sh @@ -30,9 +28,10 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu AS production ARG PROJECT_NAME ARG PIXI_ENVIRONMENT -# Copy the environment in the /jaxsim folder. -WORKDIR /$PROJECT_NAME -COPY --from=build /$PROJECT_NAME/.pixi/envs/$PIXI_ENVIRONMENT /pixi/envs/$PIXI_ENVIRONMENT +# Copy the environment created in the build image. +# It will be symlinked to the workspace folder by the entrypoint script. +WORKDIR /workspaces/$PROJECT_NAME +COPY --from=build /workspaces/$PROJECT_NAME/.pixi/envs/$PIXI_ENVIRONMENT /pixi/envs/$PIXI_ENVIRONMENT COPY --from=build /shell-hook.sh /shell-hook.sh # Set the shell-hook script as the entrypoint.