Skip to content

Instantly share code, notes, and snippets.

@christophernhill
Last active May 26, 2021 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophernhill/c44e734e0ebfe48a5814578a7abb40bc to your computer and use it in GitHub Desktop.
Save christophernhill/c44e734e0ebfe48a5814578a7abb40bc to your computer and use it in GitHub Desktop.
Dockerfile that creates environment for Ali's cube sphere Oceananigans with plotting etc....
FROM julia:1.6.1
RUN apt-get update && apt-get install -y hdf5-tools
RUN apt-get install -y ffmpeg
RUN apt-get install -y git
RUN apt-get install -y wget
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN chmod +x Miniconda3-latest-Linux-x86_64.sh
RUN ./Miniconda3-latest-Linux-x86_64.sh -b -p miniconda3
RUN . miniconda3/bin/activate && conda create -y --name=py39 python=3.9
RUN echo ". miniconda3/bin/activate" >> ~/.bashrc
RUN echo "conda activate py39" >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]
RUN conda install -y matplotlib
RUN conda install -y numpy
RUN conda install -y cartopy
RUN conda install -y scipy
RUN conda install -y --channel=conda-forge cmocean
RUN git clone https://github.com/clima/oceananigans.jl
# RUN cd oceananigans.jl/ && git checkout cnh/cube-corner-fiddling
ENV JULIA_DEPOT_PATH=/oceananigans.jl/.julia
RUN echo "cd oceananigans.jl" >> ~/.bashrc
RUN /usr/local/julia/bin/julia --project -e "using Pkg; Pkg.instantiate();"
RUN /usr/local/julia/bin/julia --project -e "using Oceananigans"
RUN /usr/local/julia/bin/julia --project -e 'using Pkg; Pkg.add("DataDeps")'
RUN /usr/local/julia/bin/julia --project -e 'using Pkg; Pkg.add("PyCall")'
RUN /usr/local/julia/bin/julia --project -e 'using PyCall; pyimport_conda("matplotlib.pyplot", "matplotlib")'
RUN /usr/local/julia/bin/julia --project -e 'using PyCall; pyimport_conda("numpy.ma", "numpy")'
RUN /usr/local/julia/bin/julia --project -e 'using PyCall; pyimport_conda("cartopy.crs", "cartopy")'
RUN /usr/local/julia/bin/julia --project -e 'using PyCall; pyimport_conda("cmocean", "cmocean","conda-forge")'
CMD ["/bin/bash","-c", "cd oceananigans.jl ; julia --project"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment