From 392f604ebae8fbac8e5012752ea669e5e4d5506f Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Fri, 3 Dec 2021 16:42:41 +0200 Subject: [PATCH] Use a single RUN command Run test file creation in single RUN command. Signed-off-by: Gabriel Adrian Samfira --- integration/images/volume-copy-up/Dockerfile_windows | 6 +++--- integration/images/volume-ownership/Dockerfile_windows | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/integration/images/volume-copy-up/Dockerfile_windows b/integration/images/volume-copy-up/Dockerfile_windows index d5af8d050..5e57623f5 100644 --- a/integration/images/volume-copy-up/Dockerfile_windows +++ b/integration/images/volume-copy-up/Dockerfile_windows @@ -26,12 +26,12 @@ RUN cmd.exe /c "@echo off && FOR %i in (%BUSYBOX_EXES%) do (mklink %i.exe busybo USER ContainerUser -RUN mkdir C:\test_dir # Explicitly set full access rights for "CREATOR OWNER". While # this is set by default for Windows Server 2019, it seems that # on Windows Server 2022 it is not. -RUN icacls C:\test_dir /grant "CREATOR OWNER":(OI)(CI)(IO)F /T -RUN /bin/sh.exe -c "echo test_content > /test_dir/test_file" +RUN mkdir C:\test_dir && \ + icacls C:\test_dir /grant "CREATOR OWNER":(OI)(CI)(IO)F /T && \ + /bin/sh.exe -c "echo test_content > /test_dir/test_file" ENV PATH="C:\bin;C:\Windows\System32;C:\Windows;" VOLUME "C:/test_dir" diff --git a/integration/images/volume-ownership/Dockerfile_windows b/integration/images/volume-ownership/Dockerfile_windows index 5c58c1217..720069096 100644 --- a/integration/images/volume-ownership/Dockerfile_windows +++ b/integration/images/volume-ownership/Dockerfile_windows @@ -27,14 +27,13 @@ RUN cmd.exe /c "@echo off && FOR %i in (%BUSYBOX_EXES%) do (mklink %i.exe busybo USER ContainerUser -RUN mkdir C:\volumes # Explicitly set full access rights for "CREATOR OWNER". While # this is set by default for Windows Server 2019, it seems that # on Windows Server 2022 it is not. -RUN icacls C:\volumes /grant "CREATOR OWNER":(OI)(CI)(IO)F /T - -RUN mkdir C:\volumes\test_dir -RUN /bin/sh.exe -c "echo test_content > /volumes/test_dir/test_file" +RUN mkdir C:\volumes && \ + icacls C:\volumes /grant "CREATOR OWNER":(OI)(CI)(IO)F /T && \ + mkdir C:\volumes\test_dir && \ + /bin/sh.exe -c "echo test_content > /volumes/test_dir/test_file" ENV PATH="C:\bin;C:\Windows\System32;C:\Windows;" VOLUME "C:/volumes/test_dir"