generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-images.sh
46 lines (37 loc) · 1.09 KB
/
build-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# Copyright (C) 2024 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Terminate on error
set -e
# Prepare variables for later use
images=()
# The image will be pushed to GitHub container registry
repobase="${REPOBASE:-ghcr.io/nethserver}"
# build the runtime image
DNSMASQ_VERSION=2.89
podman build \
--force-rm \
--layers \
--tag "${repobase}/dnsmasq-server" \
--build-arg "DNSMASQ_VERSION=${DNSMASQ_VERSION}" \
container
images+=("${repobase}/dnsmasq-server")
# Build NS8-image
podman build \
--force-rm \
--layers \
--tag "${repobase}/dnsmasq" \
--label org.nethserver.images="ghcr.io/nethserver/dnsmasq-server:${IMAGETAG:-latest}" \
.
images+=("${repobase}/dnsmasq")
if [[ -n "${CI}" ]]; then
# Set output value for Github Actions
printf "images=%s\n" "${images[*],,}" >> "${GITHUB_OUTPUT}"
else
# Just print info for manual push
printf "Publish the images with:\n\n"
for image in "${images[@],,}"; do printf " buildah push %s docker://%s:%s\n" "${image}" "${image}" "${IMAGETAG:-latest}" ; done
printf "\n"
fi