-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
2 changed files
with
25 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,43 +1,45 @@ | ||
FROM centos:7 | ||
|
||
MAINTAINER Zahari Kassabov | ||
|
||
ENV SUMMARY = "CentOS toolchain for conda recipes"\ | ||
DESCRIPTION = "Image that allows building packages uisng newer\ | ||
compilers in a way that they are compatible\ | ||
with old linuxes" | ||
|
||
#Set locale for good | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
# Download base image ubuntu latest | ||
FROM ubuntu:latest | ||
|
||
# LABEL about the custom image | ||
LABEL maintainer="NNPDF" | ||
LABEL description="Image with NNPDF tagged code." | ||
|
||
ENV CONDA_URL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh | ||
ENV CONDA_FILE Miniconda3-latest-Linux-x86_64.sh | ||
|
||
LABEL summary="$SUMMARY"\ | ||
description="$DESCRIPTION" | ||
# Disable Prompt During Packages Installation | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN yum install -y centos-release-scl &&\ | ||
yum install -y devtoolset-7 \ | ||
wget \ | ||
git \ | ||
patch | ||
# Update Ubuntu Software repository | ||
RUN apt update | ||
|
||
# Install wget | ||
RUN apt install -y wget | ||
|
||
# Install conda | ||
RUN wget "$CONDA_URL" && \ | ||
chmod +x "$CONDA_FILE" && \ | ||
./"$CONDA_FILE" -b && \ | ||
rm "$CONDA_FILE" | ||
|
||
ENV PATH /root/miniconda3/bin:$PATH | ||
|
||
# Setup conda channels | ||
RUN conda config --append channels conda-forge && \ | ||
conda config --prepend channels https://packages.nnpdf.science/public/ && \ | ||
conda config --set show_channel_urls true && \ | ||
conda install conda-build --yes | ||
conda init bash | ||
|
||
# Copy conda package to image | ||
COPY conda-bld /root/conda-bld | ||
|
||
ENV CXXFLAGS -D_GLIBCXX_USE_CXX11_ABI=1 | ||
# install the nnpdf framework | ||
RUN conda create -n nnpdfenv -c file:///root/conda-bld/linux-64 nnpdf && \ | ||
echo "conda activate nnpdfenv" >> /root/.bashrc | ||
|
||
ENTRYPOINT scl enable devtoolset-7 bash | ||
# delete package | ||
RUN rm -r /root/conda-bld | ||
|
||
# run bash as entrypoint | ||
ENTRYPOINT bash |