What does ADD rootfs.tar.xz do?

Hi,

I’m looking at building my first image, and I’m wondering the difference between starting from scratch and from the debian base image.

I see that apart from starting a bash shell, there is this line: ADD rootfs.tar.xz /

What does it do?

Hi. My guess it that provides common utilities, like “cp”, “mv” etc, just like any other OS. If you start from scratch, I guess you won’t be able access the file system among other problems. See also https://hub.docker.com/_/scratch/

The tar.xz you are talking about should cover the “installation” of the given OS.

If I have to build a debian image my self then can I use ‘ADD rootfs.tar.xz /’ instruction ? If yes, then from which path this tar file will be added ?