Build image only during build

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-10-09 16:46:51 +02:00
parent c97680772d
commit 2f177eb8df
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3
2 changed files with 11 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash -eu
source tests/docker_env.sh
build_image
#run_in_docker rm -rf CMakeFiles
run_in_docker mkdir -p build_in_docker
run_in_docker -w "$PWD/build_in_docker" cmake -DENABLE_EMULATION=1 ..

View file

@ -72,14 +72,16 @@ else
NUM_PROC="$(nproc)"
fi
# Build the Docker image
echo "Getting docker image up to date (this may take a few minutes)..."
${DOCKER} image build \
build_image() {
# Build the Docker image
echo "Getting docker image up to date (this may take a few minutes)..."
${DOCKER} image build \
-t ${DOCKER_IMAGE_TAG} \
--cache-from=${DOCKER_IMAGE_TAG} \
--network host \
--build-arg MAKEFLAGS_PARALLEL="-j ${NUM_PROC}" \
tests/docker/${MBEDTLS_DOCKER_GUEST}
}
run_in_docker()
{