Mentions légales du service

Skip to content
Snippets Groups Projects

[Docker] Adding Docker build

Merged Vicente Mataix Ferrándiz requested to merge docker/add-docker-machine into master
All threads resolved!
Files
5
docker/Dockerfile 0 → 100644
+ 56
0
# Each instruction in this file generates a new layer that gets pushed to your local image cache
# Lines preceeded by # are regarded as comments and ignored
# The line below states we will base our new image on the Latest Official Ubuntu
FROM ubuntu:latest
# Identify the maintainer of an image
LABEL maintainer="vicente.mataix-ferrandiz@inria.fr"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y clean
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y \
nano \
bash \
wget \
curl \
git \
build-essential && \
apt-get autoremove -y
RUN apt-get -y clean
# Creation of a "non-root" user
ENV USER "formation"
RUN useradd --create-home ${USER}
USER ${USER}
# Default working directory is
WORKDIR /home/${USER}
RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -b
RUN rm -rf Miniconda3-latest-Linux-x86_64.sh
# Changing to home
WORKDIR /home/${USER}
RUN git clone https://gitlab.inria.fr/formations/cpp/gettingstartedwithmoderncpp.git
# Change the default shell to be bash
SHELL ["/bin/bash", "-c"]
# Conda environment
WORKDIR /home/${USER}/gettingstartedwithmoderncpp
# RUN echo ". /home/${USER}/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc
RUN /home/${USER}/miniconda3/bin/conda env create -f environment.yml
RUN /home/${USER}/miniconda3/bin/conda init bash
# RUN source ~/.bashrc
RUN source /home/${USER}/miniconda3/etc/profile.d/conda.sh
RUN /home/${USER}/miniconda3/bin/conda clean -a
# Add to the bashrc
RUN echo "alias python=\"python3\"" >> ~/.bashrc
RUN echo "conda activate formation_cpp" >> ~/.bashrc
RUN source ~/.bashrc
CMD ["/home/formation/miniconda3/bin/conda", "run", "-n", "formation_cpp", "jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root","--NotebookApp.token=''"]
Loading