content: FROM continuumio/anaconda3 as upstream
  
  # Verify OS version is expected one
  RUN . /etc/os-release && if [ "${VERSION_CODENAME}" != "bullseye" ]; then exit 1; fi
  
  # Update, change owner
  RUN groupadd -r conda --gid 900 \
      && chown -R :conda /opt/conda \
      && chmod -R g+w /opt/conda \
      && find /opt -type d | xargs -n 1 chmod g+s
  
  # Reset and copy updated files with updated privs to keep image size down
  FROM mcr.microsoft.com/vscode/devcontainers/base:0-bullseye
  COPY --from=upstream /opt /opt/
  
  # Copy library scripts to execute
  COPY .devcontainer/library-scripts/*.sh .devcontainer/add-notice.sh .devcontainer/library-scripts/*.env /tmp/library-scripts/
  
  # Setup conda to mirror contents from https://github.com/ContinuumIO/docker-images/blob/master/anaconda3/debian/Dockerfile
  ENV LANG=C.UTF-8 \
      LC_ALL=C.UTF-8 \
      PATH=/opt/conda/bin:$PATH
  ARG USERNAME=vscode
  RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
      && apt-get install -y --no-install-recommends \
          bzip2 \
          ca-certificates \
          git \
          libglib2.0-0 \
          libsm6 \
          libxcomposite1 \
          libxcursor1 \
          libxdamage1 \
          libxext6 \
          libxfixes3 \
          libxi6 \
          libxinerama1 \
          libxrandr2 \
          libxrender1 \
          mercurial \
          openssh-client \
          procps \
          subversion \
          wget \
      && apt-get upgrade -y \
      && bash /tmp/library-scripts/add-notice.sh \
      && mv -f "/tmp/library-scripts/meta.env" /usr/local/etc/vscode-dev-containers/meta.env \
      && ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
      && echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc \
      && echo "conda activate base" >> ~/.bashrc \
      && groupadd -r conda --gid 900 \
      && usermod -aG conda ${USERNAME} \
      && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/add-notice.sh
  
  # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
  ARG NODE_VERSION="none"
  ENV NVM_DIR=/usr/local/share/nvm
  ENV NVM_SYMLINK_CURRENT=true \
      PATH=${NVM_DIR}/current/bin:${PATH}
  RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
      && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
  
  # Copy environment.yml (if found) to a temp locaition so we update the environment. Also
  # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
  COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
  RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
      && rm -rf /tmp/conda-tmp
  
  # [Optional] Uncomment this section to install additional OS packages.
  # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
  #     && apt-get -y install --no-install-recommends <your-package-list-here>
  