From 51b646e48791168c2086177a8a92764b63e3a692 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 8 Jul 2020 19:23:51 +0100 Subject: [PATCH 1/2] ci: disabled: riscv: minimise docker overlays Suggested by @bjorn3 Every RUN command creates a new overlay on top of the image as of before the RUN command. Using fewer RUN commands prevents intermediate overlays (which in this case would have contained the entire Linux source tree). --- .../docker/host-x86_64/disabled/riscv64gc-linux/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ci/docker/host-x86_64/disabled/riscv64gc-linux/Dockerfile b/src/ci/docker/host-x86_64/disabled/riscv64gc-linux/Dockerfile index 40c02ba6510..a938899636a 100644 --- a/src/ci/docker/host-x86_64/disabled/riscv64gc-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/riscv64gc-linux/Dockerfile @@ -40,9 +40,9 @@ RUN curl https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.16.tar.xz | tar cp linux.config linux-5.6.16/.config && \ cd /build/linux-5.6.16 && \ make olddefconfig && \ - make -j$(nproc) vmlinux -RUN cp linux-5.6.16/vmlinux /tmp -RUN rm -rf linux-5.6.16 + make -j$(nproc) vmlinux && \ + cp vmlinux /tmp && \ + rm -rf linux-5.6.16 # Compile an instance of busybox as this provides a lightweight system and init # binary which we will boot into. Only trick here is configuring busybox to From d9fec595e83423d7c35f0457a5c6a363fdaea02d Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 8 Jul 2020 21:57:57 +0100 Subject: [PATCH 2/2] ci: fix context for disabled docker images When the dockerfiles were moved into the host-x86_64 directory, paths for COPY commands were updated with the new host-x86_64/ prefix. This suggested that the intended context was src/ci/docker. However, the context for disabled docker images was src/ci/docker/host-x86_64. This broke the new paths and prevented src/ci/docker/scripts from being included in the context at all. This commit corrects this context allowing docker to find the files it needs for COPY commands. --- src/ci/docker/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 9bc61b56efb..c2ff62e7481 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -119,11 +119,11 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then exit 1 fi # Transform changes the context of disabled Dockerfiles to match the enabled ones - tar --transform 's#^./disabled/#./#' -C $docker_dir -c . | docker \ + tar --transform 's#disabled/#./#' -C $script_dir -c . | docker \ build \ --rm \ -t rust-ci \ - -f "$image/Dockerfile" \ + -f "host-$(uname -m)/$image/Dockerfile" \ - else echo Invalid image: $image