Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
dockerize-tutorial/tutorial2_docker_tricks/install_anaconda.dockerfile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (42 sloc)
1.58 KB
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
| # Dockerfile for hypothetical SW build system | |
| FROM ubuntu:18.04 | |
| LABEL maintainer="Ravi Chandran" | |
| SHELL ["/bin/bash", "-c"] | |
| # Using Debian Anaconda 3 prerequisites for Ubuntu from here: https://docs.anaconda.com/anaconda/install/linux/#prerequisites | |
| # Also need wget for installing Anaconda | |
| RUN apt-get update \ | |
| && DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \ | |
| libgl1-mesa-glx \ | |
| libegl1-mesa \ | |
| libxrandr2 \ | |
| libxss1 \ | |
| libxcursor1 \ | |
| libxcomposite1 \ | |
| libasound2 \ | |
| libxi6 \ | |
| libxtst6 \ | |
| wget \ | |
| && apt-get -y autoremove \ | |
| && apt-get clean autoclean \ | |
| && rm -fr /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* | |
| # install Anaconda by downloading the installer via the local http server | |
| ARG ANACONDA | |
| RUN wget --no-proxy http://10.0.2.15:8888/${ANACONDA} -O ~/anaconda.sh \ | |
| && /bin/bash ~/anaconda.sh -b -p /opt/conda \ | |
| && rm ~/anaconda.sh \ | |
| && rm -fr /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* | |
| # set path to conda | |
| ENV PATH="$PATH:/opt/conda/bin" | |
| # update Anaconda packages | |
| RUN conda update conda \ | |
| && conda update anaconda \ | |
| && conda update --all | |
| # Create non-root user:group and generate a home directory to support SSH | |
| ARG USERNAME | |
| RUN adduser --disabled-password --gecos '' ${USERNAME} \ | |
| && adduser ${USERNAME} sudo \ | |
| && echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| # Run container as non-root user from here onwards | |
| USER ${USERNAME} | |
| # run bash when container is started | |
| ENTRYPOINT [ "/bin/bash" ] |