|
|
@ -21,7 +21,6 @@ set -ex |
|
|
|
# Params: |
|
|
|
# Params: |
|
|
|
# INTEROP_IMAGE - name of tag of the final interop image |
|
|
|
# INTEROP_IMAGE - name of tag of the final interop image |
|
|
|
# BASE_NAME - base name used to locate the base Dockerfile and build script |
|
|
|
# BASE_NAME - base name used to locate the base Dockerfile and build script |
|
|
|
# TTY_FLAG - optional -t flag to make docker allocate tty |
|
|
|
|
|
|
|
# BUILD_INTEROP_DOCKER_EXTRA_ARGS - optional args to be passed to the |
|
|
|
# BUILD_INTEROP_DOCKER_EXTRA_ARGS - optional args to be passed to the |
|
|
|
# docker run command |
|
|
|
# docker run command |
|
|
|
# GRPC_ROOT - grpc base directory, default to top of this tree. |
|
|
|
# GRPC_ROOT - grpc base directory, default to top of this tree. |
|
|
@ -98,20 +97,25 @@ else |
|
|
|
docker build -t "$BASE_IMAGE" --force-rm=true "tools/dockerfile/interoptest/$BASE_NAME" || exit $? |
|
|
|
docker build -t "$BASE_IMAGE" --force-rm=true "tools/dockerfile/interoptest/$BASE_NAME" || exit $? |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -t 0 ]]; then |
|
|
|
|
|
|
|
DOCKER_TTY_ARGS="-it" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
# The input device on kokoro is not a TTY, so -it does not work. |
|
|
|
|
|
|
|
DOCKER_TTY_ARGS= |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
CONTAINER_NAME="build_${BASE_NAME}_$(uuidgen)" |
|
|
|
CONTAINER_NAME="build_${BASE_NAME}_$(uuidgen)" |
|
|
|
|
|
|
|
|
|
|
|
# Prepare image for interop tests, commit it on success. |
|
|
|
# Prepare image for interop tests, commit it on success. |
|
|
|
# TODO: Figure out if is safe to eliminate the suppression. It's currently here |
|
|
|
# TODO: Figure out if is safe to eliminate the suppression. It's currently here |
|
|
|
# because $MOUNT_ARGS and $BUILD_INTEROP_DOCKER_EXTRA_ARGS can have legitimate |
|
|
|
# because $MOUNT_ARGS and $BUILD_INTEROP_DOCKER_EXTRA_ARGS can have legitimate |
|
|
|
# spaces, but the "correct" way to do this is to utilize proper arrays. |
|
|
|
# spaces, but the "correct" way to do this is to utilize proper arrays. |
|
|
|
# Same for $TTY_FLAG |
|
|
|
|
|
|
|
# shellcheck disable=SC2086 |
|
|
|
# shellcheck disable=SC2086 |
|
|
|
(docker run \ |
|
|
|
(docker run \ |
|
|
|
--cap-add SYS_PTRACE \ |
|
|
|
--cap-add SYS_PTRACE \ |
|
|
|
-e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \ |
|
|
|
-e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \ |
|
|
|
-e THIS_IS_REALLY_NEEDED_ONCE_AGAIN='For issue 4835. See https://github.com/docker/docker/issues/14203 for why docker is awful' \ |
|
|
|
-e THIS_IS_REALLY_NEEDED_ONCE_AGAIN='For issue 4835. See https://github.com/docker/docker/issues/14203 for why docker is awful' \ |
|
|
|
-i \ |
|
|
|
$DOCKER_TTY_ARGS \ |
|
|
|
$TTY_FLAG \ |
|
|
|
|
|
|
|
$MOUNT_ARGS \ |
|
|
|
$MOUNT_ARGS \ |
|
|
|
$BUILD_INTEROP_DOCKER_EXTRA_ARGS \ |
|
|
|
$BUILD_INTEROP_DOCKER_EXTRA_ARGS \ |
|
|
|
--name="$CONTAINER_NAME" \ |
|
|
|
--name="$CONTAINER_NAME" \ |
|
|
|