Commit 55474f8b authored by Thomas Downes's avatar Thomas Downes

Update project to include an image intended to be invoked as a container

parent c9d79b5c
......@@ -4,6 +4,7 @@ image: docker:latest
variables:
DOCKER_DRIVER: overlay
TAG: $CI_REGISTRY_IMAGE:latest
NIGHTLY: $CI_REGISTRY_IMAGE:nightly
build:
only:
......@@ -11,4 +12,6 @@ build:
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --no-cache --pull -t $TAG --build-arg INSTALL_PATH=/cvmfs/ligo-containers.opensciencegrid.org/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/latest .
- docker build --no-cache --pull -t $NIGHTLY -f Dockerfile-singularity .
- docker push $TAG
- docker push $NIGHTLY
FROM debian:stretch
ARG INSTALL_PATH=/opt/conda
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH $INSTALL_PATH/bin:$PATH
RUN apt-get update --fix-missing && \
apt-get install --yes \
wget \
bzip2 \
ca-certificates \
libglib2.0-0 \
libxext6 \
libsm6 \
libxrender1 \
git \
mercurial \
subversion && \
apt-get clean
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /root/anaconda.sh && \
mkdir -p $(dirname $INSTALL_PATH) && \
/bin/bash /root/anaconda.sh -b -p $INSTALL_PATH && \
rm -f ~/anaconda.sh && \
. $INSTALL_PATH/etc/profile.d/conda.sh && \
conda update conda
COPY environment-py27.yml /tmp
RUN conda env create -f /tmp/environment-py27.yml
COPY environment-py36.yml /tmp
RUN conda env create -f /tmp/environment-py36.yml
COPY environment-py37.yml /tmp
RUN conda env create -f /tmp/environment-py37.yml
RUN conda clean --all --yes
RUN cp $INSTALL_PATH/etc/profile.d/conda.sh /etc/profile.d
COPY entrypoint /bin
RUN chmod 0755 /bin/entrypoint
ENTRYPOINT [ "entrypoint" ]
CMD [ "ligo-py37", "lal_version" ]
#!/bin/bash
# mimic a login shell by sourcing files under /etc/profile.d
# without using "-l" argument to bash a full login shell really
# wants a TTY that docker doesn't provide by default
. /etc/profile.d/conda.sh
conda activate $1
shift
exec "$@"
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