-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98f1220
commit 598ab20
Showing
1 changed file
with
15 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu | ||
COPY environment.yml /opt/environment.yml | ||
# syntax=docker/dockerfile:1.4 | ||
FROM mcr.microsoft.com/devcontainers/base:jammy | ||
|
||
# Enable by default the conda environment for all users. | ||
# The prefix is the one used by the micromamba feature. | ||
ENV CONDA_PREFIX_JAXSIM=/opt/conda/envs/jaxsim | ||
RUN echo 'function activate_conda() {' >> /etc/bash.bashrc &&\ | ||
echo ' eval "$(micromamba shell hook -s bash)"' >> /etc/bash.bashrc &&\ | ||
echo ' micromamba activate ${CONDA_PREFIX_JAXSIM-$CONDA_PREFIX}' >> /etc/bash.bashrc &&\ | ||
echo '}' >> /etc/bash.bashrc &&\ | ||
echo '[[ -x $(which micromamba) && -d ${CONDA_PREFIX_JAXSIM-$CONDA_PREFIX} ]] && activate_conda' >> /etc/bash.bashrc &&\ | ||
echo '[[ -x $(which micromamba) && ! -x $(which mamba) ]] && alias mamba="$(which micromamba)"' >> /etc/bash.bashrc &&\ | ||
echo '[[ -x $(which micromamba) && ! -x $(which conda) ]] && alias conda="$(which micromamba)"' >> /etc/bash.bashrc | ||
ARG PROJECT_NAME=jaxsim | ||
ARG PIXI_VERSION=v0.35.0 | ||
|
||
# Provide libGL.so.1 from the host OS | ||
RUN sudo apt-get update &&\ | ||
sudo apt-get install -y --no-install-recommends libgl1 &&\ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN curl -o /usr/local/bin/pixi -SL https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl \ | ||
&& chmod +x /usr/local/bin/pixi \ | ||
&& pixi info | ||
|
||
# The Python extension in VSCode is not able to detect the interpreter installed with micromamba. | ||
# As documented as follows, we provide a suggestion through an environment variable. | ||
# https://code.visualstudio.com/docs/python/environments#_where-the-extension-looks-for-environments | ||
ENV WORKON_HOME=$CONDA_PREFIX_JAXSIM | ||
# Add LFS repository and install. | ||
RUN apt-get update && apt-get install -y curl \ | ||
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \ | ||
&& apt install -y git-lfs | ||
|
||
# Specify the workdir of the container | ||
WORKDIR /workspace/jaxsim | ||
USER vscode | ||
WORKDIR /home/vscode | ||
|
||
RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc |