Commit 1276f5e4 authored by Pablo Panero's avatar Pablo Panero
Browse files

docker: add base docker image and its ci

parent 279a0637
...@@ -18,11 +18,28 @@ variables: ...@@ -18,11 +18,28 @@ variables:
### By default, there are 6 stages that we may use: ### By default, there are 6 stages that we may use:
### Feel free to adapt this to your specific case. ### Feel free to adapt this to your specific case.
stages: stages:
- build_base
- build - build
- tag_image - tag_image
- import_image # This stage is only used when the built image is stored in the GitLab Registry - import_image # This stage is only used when the built image is stored in the GitLab Registry
- deploy - deploy
### 'Build Base' stage
### Builds the base docker image and tags it according to the commit message.
build_base_image:
stage: build_base
only:
changes:
- Dockerfile-base
- Pipfile
- Pipfile.lock
tags:
- docker-image-build
script: 'echo "Building base Docker image..."'
variables:
DOCKER_FILE: Dockerfile-base
TO: gitlab-registry.cern.ch/webservices/cern-search/cern-search-rest-api/cern-search-rest-api-base:${CI_COMMIT_SHA}
### 'Build' stage ### 'Build' stage
### Build the image and store it in the registry. It is important that this step ### Build the image and store it in the registry. It is important that this step
### doesn't override the image the applications are running, as we haven't tested the image yet ### doesn't override the image the applications are running, as we haven't tested the image yet
......
# -*- coding: utf-8 -*-
# Use CentOS7:
FROM inveniosoftware/centos7-python:3.6
# Install pre-requisites
RUN yum update -y && \
yum install -y \
gcc \
openssl \
openldap-devel \
https://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/CERN-CA-certs-20180516-1.el7.cern.noarch.rpm
# CERN Search installation
WORKDIR /${WORKING_DIR}/src
ADD ./Pipfile /${WORKING_DIR}/src/Pipfile
ADD ./Pipfile.lock /${WORKING_DIR}/src/Pipfile.lock
# Install dependencies globally
RUN pipenv install --system --deploy
Supports Markdown
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