generated from epics-containers/ioc-pmac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·35 lines (27 loc) · 1.16 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
#!/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} != "linux_x86_64" ]]; then
# container image extension is the lcase of EPICS_TARGET_ARCH
IMAGE_EXT=-"${T_A,,}"
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 buildx=buildx; load=--load ; fi
if [[ $DOCKER_BUILDKIT == "0" ]]; then buildx=; load=; fi
# make sure new repos get their submodule ibek-support
if [ ! -d ibek-support/_global ] ; then git submodule update --init ; fi
# build and developer images
set -x
$docker $buildx build -t ${TAG} "${@}" $load \
--build-arg IMAGE_EXT=$IMAGE_EXT \
$runtime --target $TARGET .