Commit c323ddc8 authored by Felix Haase's avatar Felix Haase
Browse files

Add simple dockerfile and pipeline

parent 31f43da4
Pipeline #334 failed with stage
in 1 minute and 11 seconds
# This file is a template, and might need editing before it works on your project.
stages:
- build
- test
- deploy
variables:
# When using dind service, we need to instruct docker, to talk with
# the daemon started inside of the service. The daemon is available
# with a network connection instead of the default
# /var/run/docker.sock socket. docker:19.03.1 does this automatically
# by setting the DOCKER_HOST in
# https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03.1/docker-entrypoint.sh#L23-L29
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services.
#
# Note that if you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
# the variable must be set to tcp://localhost:2376 because of how the
# Kubernetes executor connects services to the job container
# DOCKER_HOST: tcp://localhost:2376
#
# Specify to Docker where to create the certificates, Docker will
# create them automatically on boot, and will create
# `/certs/client` that will be shared between the service and job
# container, thanks to volume mount from config.toml
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_DRIVER: overlay
.docker-build:
image: docker:19.03
services:
- docker:19.03-dind
before_script:
- docker version
- docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" $DOCKER_HUB
script:
- docker build -t unibasme/bambirds-testing:$VERSION
- docker push unibasme/bambirds-testing:$VERSION
docker-build-master:
# Official docker image.
stage: build
extends:
.docker-build
variables:
VERISON: latest
only:
- master
docker-build-branches:
# Official docker image.
stage: build
extends:
.docker-build
variables:
VERSION: $CI_COMMIT_REF_SLUG
except:
- master
only:
- branches
docker-build-tags:
stage: build
extends:
.docker-build
variables:
VERSION: $CI_COMMIT_REF_NAME
only:
- tags
FROM openjdk:8-jdk
LABEL maintainer="Felix Haase <felix.haase@stud.uni-bammberg.de>"
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
swi-prolog; \
rm -rf /var/lib/apt/lists/*
\ No newline at end of file
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