forked from KTH-SML/svea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·40 lines (32 loc) · 1020 Bytes
/
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
37
38
39
40
#! /bin/sh
#
# Build the image for this workspace
#
# Author: Kaj Munhoz Arfvidsson
## To build cross-platform,
## 1. use relevant CONFIG (see util/config.sh),
## 2. your host computer must have QEMU:
## > sudo apt-get install qemu-user-static
## > docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
## > docker buildx create --use
. "$(dirname "$0")/config.sh"
CMD="docker buildx build"
ARGS=""
append ARGS \
--network "host" \
--platform "$BUILD_PLATFORM" \
--build-arg "BUILD_TAG=$BUILD_TAG" \
--build-arg "ROSDISTRO=$ROSDISTRO" \
--build-arg "WORKSPACE=$WORKSPACE"
# Special case for TX2s that have old version of docker
if [ "$(jetson_release)" = "R32" ]; then
CMD="docker build"
else
append ARGS "$(ifelse IMAGE_PUSH --push --load)"
fi
# These args are replaced if util/build is called with arguments
if [ -z "$*" ]
then append ARGS --tag "$IMAGE_TAG" --file "$BUILD_FILE" "$BUILD_CONTEXT"
else append ARGS "$@"
fi
call $CMD $ARGS