Docker Community Forums

Share and learn in the Docker community.

Extract tar.gz files on different path

Hi
Here is my current Dockerfile directory:

config
app
keys
Dockerfile

Is it possible to compress all files into the single tar.gz and in docker file define which file must extract where?

Expected directory:

allconfigs.tar.gz
Dockerfile

Expected docker file something like this:

config/allconfigs.tar.gz /opt/app/config/
app/allconfigs.tar.gz /opt/app/bin/
keys/allconfigs.tar.gz /opt/keys/

Any idea?
Thanks

Starting with version 4.0, the WinZip Command Line Add-On can be used to unzip any of the archive types that are supported by WinZip. Additionally, version 4.0 can create LHA files. For simple archive types, you would use the same type of unzip command that would be used with Zip files. For example, if you need to extract the contents of a tar file or a gzip file, your commands would look like this:

wzunzip file.tar [PATH]

wzunzip -d file.gz [PATH]

If you need to extract the contents of a complex archive, such as a tar.gz or tgz file (each being an archive with a tar file inside), you would need two commands:

wzunzip file.tar.gz [PATH]
wzunzip file.tar [PATH]

Earlier versions of the add-on only support creating and unzipping Zip files (.zip or .zipx). If needed, command line tools for gzip and tar files are available in a collection of Win32 command line GNU utilities and are also available from the gzip home page.

Here is an example of how to extract the contents of a gzip file:

gzip -d file.gz

Here is an example of how to extract the contents of a tar file:

tar xvf file.tar

Here are examples of how to extract the contents of a tar.gz and a tgz file:

gzip -d < file.tar.gz | tar xvf -
gzip -d < file.tgz | tar xvf -