diff --git a/Dockerfile.template b/Dockerfile.template index 3e77ec986..a0eec25b2 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -11,8 +11,9 @@ LABEL build-date-iso8601="${build_date}" WORKDIR /root +# due https://github.com/moby/moby/issues/47021 we cannot have /root/.cache leftover as it causes random errors in CI RUN --mount=type=bind,source=${tar_path}/${tar_name},target=/tmp/${tar_name} \ - pip install --no-cache-dir /tmp/${tar_name}[full] + pip install --no-cache-dir /tmp/${tar_name}[full] && rm -rf /root/.cache ENTRYPOINT ["b2"] CMD ["--help"] diff --git a/changelog.d/+docker_mkdir_fail.infrastructure.md b/changelog.d/+docker_mkdir_fail.infrastructure.md new file mode 100644 index 000000000..d3750be17 --- /dev/null +++ b/changelog.d/+docker_mkdir_fail.infrastructure.md @@ -0,0 +1 @@ +Fix CI failing on `mkdir` when testing docker image. diff --git a/noxfile.py b/noxfile.py index d95fe7bee..b184a5443 100644 --- a/noxfile.py +++ b/noxfile.py @@ -609,11 +609,11 @@ def generate_dockerfile(session): def run_docker_tests(session, image_tag): """Run unittests against a docker image.""" + docker_run_cmd = "docker run -i -v b2:/root/ -v /tmp:/tmp:rw --env-file ENVFILE" run_integration_test( session, [ "--sut", - "docker run -i -v b2:/root -v /tmp:/tmp:rw " - f"--env-file ENVFILE {image_tag}", + f"{docker_run_cmd} {image_tag}", "--env-file-cmd-placeholder", "ENVFILE", ] @@ -622,9 +622,7 @@ def run_docker_tests(session, image_tag): run_integration_test( session, [ "--sut", - "docker run -i -v b2:/root -v /tmp:/tmp:rw " - f"--entrypoint {binary_name} " - f"--env-file ENVFILE {image_tag}", + f"{docker_run_cmd} --entrypoint {binary_name} {image_tag}", "--env-file-cmd-placeholder", "ENVFILE", ]