blob: 07199967fd6f505a186846ac255aad268545c987 [file] [log] [blame]
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +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 \
Matthias Andreas Benkard0acc5892022-06-10 06:12:15 +020020 --image=registry.access.redhat.com/ubi9/ubi-micro:latest \
21 --image=registry.access.redhat.com/ubi9/ubi-minimal:latest
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +020022
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