-
Notifications
You must be signed in to change notification settings - Fork 0
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
524e895
commit 527a3f5
Showing
1 changed file
with
19 additions
and
19 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,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"] |