Commit 05fbe965 authored by Felix Haase's avatar Felix Haase
Browse files

Update docker image

- base onadoptopenjdk
- get newer swipl version from swipl image
- add build image with build dependencies
- add base image with only runtime dependencies
- build with kaniko
parent 003078cf
Pipeline #1028 failed
......@@ -5,52 +5,28 @@ stages:
- 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
.kaniko-build:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: ['']
tags:
- build
- docker
services:
- docker:19.03-dind
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- docker build --pull -t "$IMAGE_NAME:$IMAGE_TAG" .
- docker push "$IMAGE_NAME:$IMAGE_TAG"
- /kaniko/executor --context $CI_PROJECT_DIR/$PATH --dockerfile $CI_PROJECT_DIR/$PATH/Dockerfile --destination $IMAGE_NAME/$PATH:$IMAGE_TAG
matrix:
- PATH: [build, run]
docker-build-master:
# Official docker image.
stage: build
extends:
.docker-build
.kaniko-build
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE
IMAGE_TAG: latest
......@@ -61,7 +37,7 @@ docker-build-branches:
# Official docker image.
stage: build
extends:
.docker-build
.kaniko-build
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE
IMAGE_TAG: $CI_COMMIT_REF_SLUG
......@@ -73,7 +49,7 @@ docker-build-branches:
docker-build-tags:
stage: build
extends:
.docker-build
.kaniko-build
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE
IMAGE_TAG: $CI_COMMIT_REF_NAME
......
FROM openjdk:8-jdk
FROM swipl:8.2.4 as swipl
FROM adoptopenjdk:8-jre-hotspot-focal
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 \
gcc; \
rm -rf /var/lib/apt/lists/*
\ No newline at end of file
libtcmalloc-minimal4 \
libncurses5 \
libedit2; \
rm -rf /var/lib/apt/lists/*
COPY --from=swipl /usr/lib/swipl /usr/lib/swipl
COPY --from=swipl /usr/bin/swipl /usr/bin/swipl
FROM swipl:8.2.4 as swipl
FROM adoptopenjdk:8-hotspot-focal
LABEL maintainer="Felix Haase <felix.haase@stud.uni-bammberg.de>"
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libtcmalloc-minimal4 \
libncurses5 \
libedit2 \
libboost-dev \
build-essential; \
rm -rf /var/lib/apt/lists/*
COPY --from=swipl /usr/lib/swipl /usr/lib/swipl
COPY --from=swipl /usr/bin/swipl /usr/bin/swipl
COPY --from=swipl /usr/bin/swipl-ld /usr/bin/swipl-ld
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