32.2k views
1 vote
How do you export the image 'httpd:latest' to a tar file called ' '?

a) docker save -o httpd_latest.tar httpd:latest
b) docker export -o httpd_latest.tar httpd:latest
c) docker archive -o httpd_latest.tar httpd:latest
d) docker package -o httpd_latest.tar httpd:latest

User Tinproject
by
8.5k points

1 Answer

5 votes

Final answer:

To export the 'httpd:latest' Docker image to a tar file, you should use the command 'docker save -o httpd_latest.tar httpd:latest'. This command packages the image into the specified tar file.

Step-by-step explanation:

To export the image 'httpd:latest' to a tar file, you would use the Docker save command. The correct command to export the Docker image to a tar file is option a):

docker save -o httpd_latest.tar httpd:latest

This command will save the 'httpd:latest' Docker image into a tar file named 'httpd_latest.tar'. The -o flag stands for output and it specifies the name of the tar file to which the image should be saved. Note that docker export is used to export a container's filesystem, not an image, hence it is not the correct choice for this task.

User Christian Semrau
by
7.6k points