Get a File from a Windows Share

Todays challenge was to get a data dump from a Windows share during creation of a Dockerfile. The interactive solution is pretty straight forward and easy with the use of smbclient...

$ smbclient '//windows-server2008.intranet/data_dumps' -c 'get data.zip' -U intranet\\fluffi
Enter intranet\fluffi's password:
Domain=[INTRANET] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]
getting file \data.zip of size 77529933 as data.zip (66842.8 KiloBytes/sec) (average 66842.8 KiloBytes/sec)

but it took quite some time to get this done effectively during within a Docker build where user interaction is not possible. The result is this slightly modified RUN command:

$ RUN smbclient '//windows-server2008.intranet/data_dumps' -q -c 'get data.zip -' -U intranet\\docker%${PASSWORD} | bsdtar -xvf- -C ${DATA_IMPORTS}
Show Comments