blob: 01347d7aec711e597804c5f026c061f1d4f94feb [file] [log] [blame]
Matthias Andreas Benkardc83e8de2022-05-13 15:25:56 +02001#! /bin/sh
2# SPDX-FileCopyrightText: © 2022 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
3#
4# SPDX-License-Identifier: GPL-3.0-or-later
5
6set -euo pipefail
7
8cd "$(dirname $(readlink -e "$0"))"
9
10image=docker.benkard.de/mulk/openjdk-runtime:latest
11use_kaniko=no
12
13./prepare
14
15if [[ "${use_kaniko}" == yes ]]; then
16 docker run \
17 --mount type=bind,src="$PWD",target=/workspace \
18 gcr.io/kaniko-project/warmer:latest \
19 --cache-dir=/workspace/cache \
20 --image=registry.access.redhat.com/ubi8/ubi-micro:latest \
21 --image=registry.access.redhat.com/ubi8/ubi-minimal:latest
22
23 docker run \
24 --mount type=bind,src="$PWD",target=/workspace \
25 --mount type=bind,src="$HOME/.docker",target=/root/.docker,ro=true \
26 gcr.io/kaniko-project/executor:latest \
27 --dockerfile Dockerfile \
28 --destination "${image}" \
29 --context dir:///workspace/ \
30 --cache=true \
31 --cache-ttl=16800h0m0s \
32 --reproducible=true
33else
34 docker build -t "${image}" .
35 docker push "${image}"
36fi