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
2 changed files with 11 additions and 8 deletions

View File

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

View File

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