Debian Codegraph @

kokoro/linux/aarch64/dockcross_helpers/run_dockcross_linux_aarch64.sh

raw
1 #!/bin/bash
2
3 set -e
4
5 # go to the repo root
6 cd $(dirname $0)/../../../..
7
8 if [[ -t 0 ]]; then
9 DOCKER_TTY_ARGS="-it"
10 else
11 # The input device on kokoro is not a TTY, so -it does not work.
12 DOCKER_TTY_ARGS=
13 fi
14
15 # Pin the dockcross image since newer versions of the image break the build
16 PINNED_DOCKCROSS_IMAGE_VERSION=dockcross/linux-arm64:20210625-795dd4d
17
18 # running dockcross image without any arguments generates a wrapper
19 # scripts that can be used to run commands under the dockcross image
20 # easily.
21 # See https://github.com/dockcross/dockcross#usage for details
22 docker run $DOCKER_TTY_ARGS --rm $PINNED_DOCKCROSS_IMAGE_VERSION >dockcross-linux-arm64.sh
23 chmod +x dockcross-linux-arm64.sh
24
25 # the wrapper script has CRLF line endings and bash doesn't like that
26 # so we change CRLF line endings into LF.
27 sed -i 's/\r//g' dockcross-linux-arm64.sh
28
29 # The dockcross wrapper script runs arbitrary commands under the selected dockcross
30 # image with the following properties which make its use very convenient:
31 # * the current working directory is mounted under /work so the container can easily
32 # access the current workspace
33 # * the processes in the container run under the same UID and GID as the host process so unlike
34 # vanilla "docker run" invocations, the workspace doesn't get polluted with files
35 # owned by root.
36 ./dockcross-linux-arm64.sh --image $PINNED_DOCKCROSS_IMAGE_VERSION -- "$@"