Commit 11440f42 authored by Alexandre Beelen's avatar Alexandre Beelen

Add mar18c and cleaner multistage build process

parent d1729281
FROM debian:stretch
ARG release
ENV release=${release}
RUN apt-get -y update && apt-get install -y libx11-6 libpng16-16 libfftw3-3 libcfitsio5 libforms2 python python-numpy python3 python3 libgtk2.0 curl
RUN echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc
COPY gildas-exe-$release.tar.gz /
RUN tar xvzf gildas-exe-$release.tar.gz
RUN apt-get -y update && apt-get install -y \
libx11-6 \
libpng16-16 \
libfftw3-3 \
libcfitsio5 \
libforms2 \
python \
python-numpy \
python3 \
python3-numpy \
libgtk2.0
RUN echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && \
echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && \
echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc
COPY gildas-exe-$release .
# COPY gildas-exe-$release.tar.gz /
# RUN tar xvzf gildas-exe-$release.tar.gz
FROM debian:stretch
ARG release
ENV release=${release}
RUN apt-get -y update && apt-get install -y libx11-dev libpng-dev libfftw3-dev libcfitsio-dev libforms-dev python-dev python-numpy python3-dev python3-numpy libgtk2.0-dev gfortran curl
RUN curl http://www.iram.fr/~gildas/dist/gildas-src-$release.tar.gz | tar xz
RUN bash -c "cd gildas-src-$release && GAG_SEARCH_PATH=/usr/lib/x86_64-linux-gnu source admin/gildas-env.sh && make && make install"
RUN echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc
RUN rm -Rf gildas-src-$release
RUN cd gildas-exe-$release && curl http://www.iram.fr/~gildas/dist/gildas-doc-$release.tar.gz | tar xz
RUN apt-get -y update && apt-get install -y \
libx11-dev \
libpng-dev \
libfftw3-dev \
libcfitsio-dev \
libforms-dev \
python-dev \
python-numpy \
python3-dev \
python3-numpy \
libgtk2.0-dev \
gfortran \
curl
RUN curl http://www.iram.fr/~gildas/dist/gildas-src-$release.tar.gz | tar xz && \
bash -c "cd gildas-src-$release && GAG_SEARCH_PATH=/usr/lib/x86_64-linux-gnu source admin/gildas-env.sh && make && make -j 4 install" && \
echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc && \
rm -Rf gildas-src-$release && \
cd gildas-exe-$release && curl http://www.iram.fr/~gildas/dist/gildas-doc-$release.tar.gz | tar xz
FROM debian:stretch as builder
ARG release
ENV release=${release}
RUN apt-get -y update && apt-get install -y \
libx11-dev \
libpng-dev \
libfftw3-dev \
libcfitsio-dev \
libforms-dev \
python-dev \
python-numpy \
python3-dev \
python3-numpy \
libgtk2.0-dev \
gfortran \
curl
RUN curl http://www.iram.fr/~gildas/dist/gildas-src-$release.tar.gz | tar xz && \
bash -c "cd gildas-src-$release && GAG_SEARCH_PATH=/usr/lib/x86_64-linux-gnu source admin/gildas-env.sh && make && make -j 4 install" && \
echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc && \
rm -Rf gildas-src-$release && \
cd gildas-exe-$release && curl http://www.iram.fr/~gildas/dist/gildas-doc-$release.tar.gz | tar xz
FROM debian:stretch
ARG release
ENV release=${release}
RUN apt-get -y update && apt-get install -y \
libx11-6 \
libpng16-16 \
libfftw3-3 \
libcfitsio5 \
libforms2 \
python \
python-numpy \
python3 \
python3-numpy \
libgtk2.0
RUN echo 'export GAG_ROOT_DIR=/gildas-exe-$release' >> /etc/bash.bashrc && \
echo 'export GAG_EXEC_SYSTEM=x86_64-debian9-gfortran' >> /etc/bash.bashrc && \
echo 'source $GAG_ROOT_DIR/etc/bash_profile' >> /etc/bash.bashrc
COPY --from=builder /gildas-exe-$release .
Build
=====
# Build
## Two stages build
Build the developpement image :
```bash
export release=mar18c
docker build -f Dockerfile.dev . --build-arg release=$release
docker build --tag abeelen/gildas:build --build-arg release=$release -f Dockerfile.dev .
```
tag it
```bash
docker tag $release abeelen/gildas:build
```
extract the compiled files
and make a tar from the files
```
docker run -it -u $(id -u) \
-v "/home/$USER:/home/$USER" \
abeelen/gildas:build tar cvzf $PWD/gildas-exe-$release.tar.gz /gildas-exe-$release
docker container create --name extract abeelen/gildas:build
docker container cp extract:/gildas-exe-$release gildas-exe-$release
docker container rm -f extract
```
# extract the compiled files
# ```
# docker run -it -u $(id -u) \
# -v "/home/$USER:/home/$USER" \
# abeelen/gildas:build tar cvzf $PWD/gildas-exe-$release.tar.gz /gildas-exe-$release
# ```
Build the execution image :
```bash
docker build -f Dockerfile . --build-arg release=$release
docker build --tag abeelen/gildas:$release --tag abeelen/gildas:latest --build-arg release=$release -f Dockerfile .
```
Finally tag this one
```bash
docker tag $release abeelen/gildas:$release
```
## One stage build
With Docker 17.05 or higher :
``bash
export release=mar18c
docker build --tag abeelen/gildas:$release --tag abeelen/gildas:latest --build-arg release=$release -f Dockerfile.multistage .
``
# Usage
Usage
=====
To launch gildas, simply launch :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment