Skip to content

Instantly share code, notes, and snippets.

@gabriel-samfira
Created April 5, 2023 12:07
Show Gist options
  • Save gabriel-samfira/9ee90ebd943e30d96971b6e9ef6a7cba to your computer and use it in GitHub Desktop.
Save gabriel-samfira/9ee90ebd943e30d96971b6e9ef6a7cba to your computer and use it in GitHub Desktop.
C:\Users\Administrator\work\playground\with-drive-letter>docker build -t docker.samfira.com/volume-copy-up:2.6 .
Sending build context to Docker daemon 5.253MB
Step 1/19 : FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ltsc2022: Pulling from windows/nanoserver
9e0d440fca83: Already exists
Digest: sha256:3bb312dcc36fa551766a13cf2fb8e2be90726774589c96bea9198a26307bf2a2
Status: Downloaded newer image for mcr.microsoft.com/windows/nanoserver:ltsc2022
---> 0c7fb865d8dc
Step 2/19 : ADD https://github.com/kubernetes-sigs/windows-testing/raw/3fea3d48ea8337b2aaca755c1d719e34b45f46b9/images/busybox/busybox.exe /bin/busybox.exe
Downloading [==================================================>] 575kB/575kB
---> 5b132076d299
Step 3/19 : ENV BUSYBOX_EXES="[ [[ ar arch ash awk base64 basename bash bunzip2 bzcat bzip2 cal cat chmod cksum clear cmp comm cp cpio cut date dc dd df diff dirname dos2unix dpkg-deb du echo ed egrep env expand e xpr factor false fgrep find fold fsync ftpget ftpput getopt grep groups gunzip gzip hd head hexdump id ipcalc kill killall less link ln logname ls lzcat lzma lzop lzopcat man md5sum mkdir mktemp mv nl od paste patch pgrep pidof pipe_progress pkill printenv printf ps pwd rev rm rmdir rpm rpm2cpio sed seq sh sha1sum sha256sum sha3sum sha512sum shred shuf sleep sort split ssl_client stat strings sum ta c tail tar tee test timeout touch tr true truncate ttysize uname uncompress unexpand uniq unix2dos unlink unlzma unlzop unxz unzip usleep uudecode uuencode vi watch wc wget which whoami whois xargs xxd xz xzcat yes zcat"
---> Running in e588b208ec17
Removing intermediate container e588b208ec17
---> 6e858a2671b8
Step 4/19 : USER ContainerAdministrator
---> Running in c0e06095a21a
Removing intermediate container c0e06095a21a
---> a3f279df4248
Step 5/19 : WORKDIR C:/bin
---> Running in ccfb6d0341c1
Removing intermediate container ccfb6d0341c1
---> d06339ffafb6
Step 6/19 : RUN cmd.exe /c "@echo off && FOR %i in (%BUSYBOX_EXES%) do (mklink %i.exe busybox.exe)"
---> Running in bc8801e82676
symbolic link created for [.exe <<===>> busybox.exe
symbolic link created for [[.exe <<===>> busybox.exe
symbolic link created for ar.exe <<===>> busybox.exe
symbolic link created for arch.exe <<===>> busybox.exe
symbolic link created for ash.exe <<===>> busybox.exe
symbolic link created for awk.exe <<===>> busybox.exe
symbolic link created for base64.exe <<===>> busybox.exe
symbolic link created for basename.exe <<===>> busybox.exe
symbolic link created for bash.exe <<===>> busybox.exe
symbolic link created for bunzip2.exe <<===>> busybox.exe
symbolic link created for bzcat.exe <<===>> busybox.exe
symbolic link created for bzip2.exe <<===>> busybox.exe
symbolic link created for cal.exe <<===>> busybox.exe
symbolic link created for cat.exe <<===>> busybox.exe
symbolic link created for chmod.exe <<===>> busybox.exe
symbolic link created for cksum.exe <<===>> busybox.exe
symbolic link created for clear.exe <<===>> busybox.exe
symbolic link created for cmp.exe <<===>> busybox.exe
symbolic link created for comm.exe <<===>> busybox.exe
symbolic link created for cp.exe <<===>> busybox.exe
symbolic link created for cpio.exe <<===>> busybox.exe
symbolic link created for cut.exe <<===>> busybox.exe
symbolic link created for date.exe <<===>> busybox.exe
symbolic link created for dc.exe <<===>> busybox.exe
symbolic link created for dd.exe <<===>> busybox.exe
symbolic link created for df.exe <<===>> busybox.exe
symbolic link created for diff.exe <<===>> busybox.exe
symbolic link created for dirname.exe <<===>> busybox.exe
symbolic link created for dos2unix.exe <<===>> busybox.exe
symbolic link created for dpkg-deb.exe <<===>> busybox.exe
symbolic link created for du.exe <<===>> busybox.exe
symbolic link created for echo.exe <<===>> busybox.exe
symbolic link created for ed.exe <<===>> busybox.exe
symbolic link created for egrep.exe <<===>> busybox.exe
symbolic link created for env.exe <<===>> busybox.exe
symbolic link created for expand.exe <<===>> busybox.exe
symbolic link created for e.exe <<===>> busybox.exe
symbolic link created for xpr.exe <<===>> busybox.exe
symbolic link created for factor.exe <<===>> busybox.exe
symbolic link created for false.exe <<===>> busybox.exe
symbolic link created for fgrep.exe <<===>> busybox.exe
symbolic link created for find.exe <<===>> busybox.exe
symbolic link created for fold.exe <<===>> busybox.exe
symbolic link created for fsync.exe <<===>> busybox.exe
symbolic link created for ftpget.exe <<===>> busybox.exe
symbolic link created for ftpput.exe <<===>> busybox.exe
symbolic link created for getopt.exe <<===>> busybox.exe
symbolic link created for grep.exe <<===>> busybox.exe
symbolic link created for groups.exe <<===>> busybox.exe
symbolic link created for gunzip.exe <<===>> busybox.exe
symbolic link created for gzip.exe <<===>> busybox.exe
symbolic link created for hd.exe <<===>> busybox.exe
symbolic link created for head.exe <<===>> busybox.exe
symbolic link created for hexdump.exe <<===>> busybox.exe
symbolic link created for id.exe <<===>> busybox.exe
symbolic link created for ipcalc.exe <<===>> busybox.exe
symbolic link created for kill.exe <<===>> busybox.exe
symbolic link created for killall.exe <<===>> busybox.exe
symbolic link created for less.exe <<===>> busybox.exe
symbolic link created for link.exe <<===>> busybox.exe
symbolic link created for ln.exe <<===>> busybox.exe
symbolic link created for logname.exe <<===>> busybox.exe
symbolic link created for ls.exe <<===>> busybox.exe
symbolic link created for lzcat.exe <<===>> busybox.exe
symbolic link created for lzma.exe <<===>> busybox.exe
symbolic link created for lzop.exe <<===>> busybox.exe
symbolic link created for lzopcat.exe <<===>> busybox.exe
symbolic link created for man.exe <<===>> busybox.exe
symbolic link created for md5sum.exe <<===>> busybox.exe
symbolic link created for mkdir.exe <<===>> busybox.exe
symbolic link created for mktemp.exe <<===>> busybox.exe
symbolic link created for mv.exe <<===>> busybox.exe
symbolic link created for nl.exe <<===>> busybox.exe
symbolic link created for od.exe <<===>> busybox.exe
symbolic link created for paste.exe <<===>> busybox.exe
symbolic link created for patch.exe <<===>> busybox.exe
symbolic link created for pgrep.exe <<===>> busybox.exe
symbolic link created for pidof.exe <<===>> busybox.exe
symbolic link created for pipe_progress.exe <<===>> busybox.exe
symbolic link created for pkill.exe <<===>> busybox.exe
symbolic link created for printenv.exe <<===>> busybox.exe
symbolic link created for printf.exe <<===>> busybox.exe
symbolic link created for ps.exe <<===>> busybox.exe
symbolic link created for pwd.exe <<===>> busybox.exe
symbolic link created for rev.exe <<===>> busybox.exe
symbolic link created for rm.exe <<===>> busybox.exe
symbolic link created for rmdir.exe <<===>> busybox.exe
symbolic link created for rpm.exe <<===>> busybox.exe
symbolic link created for rpm2cpio.exe <<===>> busybox.exe
symbolic link created for sed.exe <<===>> busybox.exe
symbolic link created for seq.exe <<===>> busybox.exe
symbolic link created for sh.exe <<===>> busybox.exe
symbolic link created for sha1sum.exe <<===>> busybox.exe
symbolic link created for sha256sum.exe <<===>> busybox.exe
symbolic link created for sha3sum.exe <<===>> busybox.exe
symbolic link created for sha512sum.exe <<===>> busybox.exe
symbolic link created for shred.exe <<===>> busybox.exe
symbolic link created for shuf.exe <<===>> busybox.exe
symbolic link created for sleep.exe <<===>> busybox.exe
symbolic link created for sort.exe <<===>> busybox.exe
symbolic link created for split.exe <<===>> busybox.exe
symbolic link created for ssl_client.exe <<===>> busybox.exe
symbolic link created for stat.exe <<===>> busybox.exe
symbolic link created for strings.exe <<===>> busybox.exe
symbolic link created for sum.exe <<===>> busybox.exe
symbolic link created for ta.exe <<===>> busybox.exe
symbolic link created for c.exe <<===>> busybox.exe
symbolic link created for tail.exe <<===>> busybox.exe
symbolic link created for tar.exe <<===>> busybox.exe
symbolic link created for tee.exe <<===>> busybox.exe
symbolic link created for test.exe <<===>> busybox.exe
symbolic link created for timeout.exe <<===>> busybox.exe
symbolic link created for touch.exe <<===>> busybox.exe
symbolic link created for tr.exe <<===>> busybox.exe
symbolic link created for true.exe <<===>> busybox.exe
symbolic link created for truncate.exe <<===>> busybox.exe
symbolic link created for ttysize.exe <<===>> busybox.exe
symbolic link created for uname.exe <<===>> busybox.exe
symbolic link created for uncompress.exe <<===>> busybox.exe
symbolic link created for unexpand.exe <<===>> busybox.exe
symbolic link created for uniq.exe <<===>> busybox.exe
symbolic link created for unix2dos.exe <<===>> busybox.exe
symbolic link created for unlink.exe <<===>> busybox.exe
symbolic link created for unlzma.exe <<===>> busybox.exe
symbolic link created for unlzop.exe <<===>> busybox.exe
symbolic link created for unxz.exe <<===>> busybox.exe
symbolic link created for unzip.exe <<===>> busybox.exe
symbolic link created for usleep.exe <<===>> busybox.exe
symbolic link created for uudecode.exe <<===>> busybox.exe
symbolic link created for uuencode.exe <<===>> busybox.exe
symbolic link created for vi.exe <<===>> busybox.exe
symbolic link created for watch.exe <<===>> busybox.exe
symbolic link created for wc.exe <<===>> busybox.exe
symbolic link created for wget.exe <<===>> busybox.exe
symbolic link created for which.exe <<===>> busybox.exe
symbolic link created for whoami.exe <<===>> busybox.exe
symbolic link created for whois.exe <<===>> busybox.exe
symbolic link created for xargs.exe <<===>> busybox.exe
symbolic link created for xxd.exe <<===>> busybox.exe
symbolic link created for xz.exe <<===>> busybox.exe
symbolic link created for xzcat.exe <<===>> busybox.exe
symbolic link created for yes.exe <<===>> busybox.exe
symbolic link created for zcat.exe <<===>> busybox.exe
Removing intermediate container bc8801e82676
---> 9b87b2b72bb6
Step 7/19 : ADD set-owner.exe C:/Windows/System32/set-owner.exe
---> 5b75b576baf5
Step 8/19 : ADD get-owner.exe C:/Windows/System32/get-owner.exe
---> ca17a6f9c8f3
Step 9/19 : USER ContainerUser
---> Running in 7c4050674de2
Removing intermediate container 7c4050674de2
---> eca62fddff10
Step 10/19 : RUN mkdir C:\test_dir && icacls C:\test_dir /grant "CREATOR OWNER":(OI)(CI)(IO)F /T && icacls C:\test_dir /grant "ContainerUser":(OI)(CI)(IO)F /T && /bin/sh.exe -c "echo test_content > /test_dir/test_file"
---> Running in 60597965ab5f
processed file: C:\test_dir
Successfully processed 1 files; Failed processing 0 files
processed file: C:\test_dir
Successfully processed 1 files; Failed processing 0 files
Removing intermediate container 60597965ab5f
---> ffe057b9306c
Step 11/19 : USER ContainerAdministrator
---> Running in c470b4dcf224
Removing intermediate container c470b4dcf224
---> bc7d0f9553e1
Step 12/19 : RUN set-owner.exe C:\test_dir S-1-5-93-2-2
---> Running in d85e00d32dc4
Removing intermediate container d85e00d32dc4
---> b23355386a25
Step 13/19 : RUN get-owner.exe C:\test_dir
---> Running in 3ff7557d0896
Administrators:S-1-5-32-544
Removing intermediate container 3ff7557d0896
---> 799163ea1d9a
Step 14/19 : RUN mkdir C:\volumes\test_dir
---> Running in 391b1fbcae6a
Removing intermediate container 391b1fbcae6a
---> 86c2618ec02a
Step 15/19 : RUN set-owner.exe C:\volumes\test_dir S-1-5-93-2-2
---> Running in 8f268600c5b5
Removing intermediate container 8f268600c5b5
---> ac2809192455
Step 16/19 : RUN get-owner.exe C:\volumes\test_dir
---> Running in f103e2f5f773
ContainerUser:S-1-5-93-2-2
Removing intermediate container f103e2f5f773
---> 4f59d006a82c
Step 17/19 : USER ContainerUser
---> Running in 3a72df4507a3
Removing intermediate container 3a72df4507a3
---> abc1c7bfbc97
Step 18/19 : ENV PATH="C:\bin;C:\Windows\System32;C:\Windows;"
---> Running in c5deb64eba17
Removing intermediate container c5deb64eba17
---> bd3a295575c2
Step 19/19 : VOLUME ["C:/test_dir", "D:"]
---> Running in 075c9839af89
Removing intermediate container 075c9839af89
---> d729fec81fc2
Successfully built d729fec81fc2
Successfully tagged docker.samfira.com/volume-copy-up:2.6
C:\Users\Administrator\work\playground\with-drive-letter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment