Skip to content

Commit

Permalink
Update Dockerfile.devenv
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanieleroux authored Oct 10, 2024
1 parent 524e895 commit 527a3f5
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Dockerfiles/Dockerfile.devenv
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Build stage with Spack pre-installed and ready to be used
FROM spack/ubuntu-jammy:0.21 AS builder
# Base image with Jupyter and common libraries
FROM jupyter/scipy-notebook:latest

# Install software from spack_devenv.yaml
RUN mkdir /opt/spack-environment
# Install Spack and additional packages
RUN apt-get update && apt-get install -y \
git build-essential curl vim && \
rm -rf /var/lib/apt/lists/*

# Install Spack
RUN git clone https://github.com/spack/spack.git /opt/spack && \
. /opt/spack/share/spack/setup-env.sh && \
spack install gcc@11.4.0

# Copy spack.yaml to configure the environment
COPY Dockerfiles/spack.yaml /opt/spack-environment/spack.yaml
RUN source /opt/spack/share/spack/setup-env.sh && \

# Install software from spack.yaml
RUN . /opt/spack/share/spack/setup-env.sh && \
cd /opt/spack-environment && \
spack env activate . && \
spack install --fail-fast && \
spack gc -y

# Bare OS image to run the installed executables
FROM ubuntu:22.04

# Copy necessary files from the builder stage
COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /usr /usr
COPY --from=builder /opt/views /opt/views

# Copy entrypoint script
# Set default entrypoint
COPY Dockerfiles/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Set entrypoint and default command
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--no-browser", "--allow-root"]

0 comments on commit 527a3f5

Please sign in to comment.