Docker ADD command


This is a question that I came across in the course:

What is the right instruction to download a file from “https://file.tar.xz” and auto-extract it into “/testdir” in the image?

And the correct answer is

Add https://file.tar.xz /testdir

However, in this document (see the comment below as I cannot post more than two links) , it says

If is a local tar archive in a recognized compression format (identity, gzip, bzip2 or xz) then it is unpacked as a directory. Resources from remote URLs are not decompressed.

So I guess the command above won’t automatically extract because the source is a remote. Please correct me if I’m wrong

Here is the link to the document I mentioned above:

Yes, since it is a remote you will not be able to automatically extract it.
Although I’d recommend doing the download, unpack, and cleanup as a single RUN command in your Dockerfile

Yes, so the answer should be none of the above answer because the add instruction won’t automatically extract as the question described.