-
Notifications
You must be signed in to change notification settings - Fork 4
/
build
executable file
·37 lines (28 loc) · 1.13 KB
/
build
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
#!/bin/bash
################################################################################
# generic local build script for epics-containers repositories #
################################################################################
set -e
# set EPICS_TARGET_ARCH to rtems for RTEMS based targets
T_A=${EPICS_TARGET_ARCH:-linux_x86_64}
# set TARGET to runtime for runtime images
TARGET=${TARGET:-developer}
# set TAG to override the default tag
TAG=${TAG:-ec_test}
if [ "$T_A" = "RTEMS-beatnik" ]; then
base="ghcr.io/epics-containers/rtems-beatnik-runtime"
else
base="ubuntu:22.04"
fi
cd $(dirname ${0})
# use docker if available else use podman
if ! docker version &>/dev/null; then docker=podman; else docker=docker; fi
if $docker buildx version &>/dev/null; then builx=buildx; load='--load --progress=plain'; fi
# make sure new repos get their submodule ibek-support
if [ ! -d ibek-support ] ; then git submodule update --init ; fi
# build and developer images
set -x
$docker build $buildx -t ${TAG} "${@}" $load \
--build-arg EPICS_TARGET_ARCH=$T_A \
--build-arg BASE_IMAGE=$base \
--target $TARGET .