Lines Matching +full:is +full:- +full:docker
1 #!/bin/bash -eu
6 # -------
8 # This is a helper script to enable running tests under a Docker container,
12 # WARNING: the Dockerfile used by this script is no longer maintained! See
13 # https://github.com/Mbed-TLS/mbedtls-test/blob/master/README.md#quick-start
14 # for the set of Docker images we use on the CI.
17 # ---------------
18 # This script expects a Linux x86_64 system with a recent version of Docker
21 # (http_proxy and https_proxy) set appropriately. If an alternate Docker
22 # registry is needed, specify MBEDTLS_DOCKER_REGISTRY to point at the
26 # Running this script directly will check for Docker availability and set up
27 # the Docker image.
30 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
37 DOCKER_IMAGE_TAG="armmbed/mbedtls-test:${MBEDTLS_DOCKER_GUEST}"
39 # Make sure docker is available
40 if ! which docker > /dev/null; then
41 …echo "Docker is required but doesn't seem to be installed. See https://www.docker.com/ to get star…
45 # Figure out if we need to 'sudo docker'
46 if groups | grep docker > /dev/null; then
47 DOCKER="docker"
49 echo "Using sudo to invoke docker since you're not a member of the docker group..."
50 DOCKER="sudo docker"
55 NUM_PROC="$(sysctl -n hw.logicalcpu)"
60 # Build the Docker image
61 echo "Getting docker image up to date (this may take a few minutes)..."
62 ${DOCKER} image build \
63 -t ${DOCKER_IMAGE_TAG} \
64 --cache-from=${DOCKER_IMAGE_TAG} \
65 --build-arg MAKEFLAGS_PARALLEL="-j ${NUM_PROC}" \
66 --network host \
67 ${http_proxy+--build-arg http_proxy=${http_proxy}} \
68 ${https_proxy+--build-arg https_proxy=${https_proxy}} \
69 ${MBEDTLS_DOCKER_REGISTRY+--build-arg MY_REGISTRY="${MBEDTLS_DOCKER_REGISTRY}/"} \
70 tests/docker/${MBEDTLS_DOCKER_GUEST}
75 while [ "$1" == "-e" ]; do
80 ${DOCKER} container run -it --rm \
81 --cap-add SYS_PTRACE \
82 --user "$(id -u):$(id -g)" \
83 --volume $PWD:$PWD \
84 --workdir $PWD \
85 -e MAKEFLAGS \
86 -e PYLINTHOME=/tmp/.pylintd \