Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo authored Nov 8, 2024
1 parent 236a062 commit 47a8c90
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 47a8c90

Please sign in to comment.