Commit bdfcf080 authored by Andrea Manzi's avatar Andrea Manzi
Browse files

fix docker build for tag release

parent 31f1619b
Pipeline #389798 canceled with stage
image: docker:latest
stages:
- build
- tag
variables:
CONTAINER_TEST_IMAGE: gitlab-registry.cern.ch/fts/fts-rest:latest
CONTAINER_RELEASE_IMAGE: gitlab-registry.cern.ch/fts/fts-rest:$CI_BUILD_REF_NAME
before_script:
- docker info
- docker login -p "${REGISTRY_PASSWD}" -u "${REGISTRY_USER}" gitlab-registry.cern.ch
after_script:
- docker logout gitlab-registry.cern.ch
build:
stage: build
only:
- develop
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE packaging/docker
- docker push $CONTAINER_TEST_IMAGE
- ""
variables:
TO: gitlab-registry.cern.ch/fts/fts-rest:latest
DOCKER_FILE: packaging/docker/Dockerfile
tags:
- docker
- docker-image-build
tag:
stage: tag
only:
- tags
script:
- docker build -t $CONTAINER_RELEASE_IMAGE --build-arg ftsrepo=http://fts-repo.web.cern.ch/fts-repo/fts3-rc-el7.repo --build-arg dmcrepo=http://dmc-repo.web.cern.ch/dmc-repo/dmc-rc-el7.repo packaging/docker
- docker push $CONTAINER_RELEASE_IMAGE
- ""
variables:
TO: gitlab-registry.cern.ch/fts/fts-rest:$CI_BUILD_REF_NAME
DOCKER_FILE: packaging/docker/Dockerfile-release
tags:
- docker
- docker-image-build
FROM centos:7
MAINTAINER CERN
#add EPEL repos
ADD http://mirror.switch.ch/ftp/mirror/epel/epel-release-latest-7.noarch.rpm /tmp/epel-release-7.noarch.rpm
RUN yum localinstall /tmp/epel-release-7.noarch.rpm -y \
&& /usr/bin/yum --enablerepo=*-testing clean all \
&& rm /tmp/epel-release-7.noarch.rpm \
&& rm -rf /var/cache/yum
# add FTS repo
ARG ftsrepo=http://fts-repo.web.cern.ch/fts-repo/fts3-rc-el7.repo
ADD $ftsrepo /etc/yum.repos.d/fts.repo
#add DMC repo
ARG dmcrepo=http://dmc-repo.web.cern.ch/dmc-repo/dmc-rc-el7.repo
ADD $dmcrepo /etc/yum.repos.d/dmc.repo
RUN /usr/bin/yum clean all
RUN /usr/bin/yum install -y fts-rest-selinux fts-rest httpd MySQL-python
RUN /usr/bin/yum install -y voms-config-wlcg voms-config-vo-dteam
#add user
RUN useradd fts3 && usermod -a -G fts3 apache
RUN mkdir -p /var/log/fts3rest && chown fts3:fts3 /var/log/fts3rest
#expose port
EXPOSE 8446
CMD ["/usr/sbin/apachectl","-DFOREGROUND"]
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