What is docker s scratch image

0 votes
I'm new to Docker and was experimenting with the first hello world example in the documentation. The hello-world image, as far as I can tell, is built on top of the scratch image. Is it possible for someone to explain how the scratch image works? It's essentially blank, as far as I can tell. So, how is the binary in the hello-world image executed?
Apr 20, 2022 in Docker by pranav
• 2,590 points
600 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The scratch image is Docker's most basic image. All other photos have this as their ancestor. The scratch image is, in fact, blank. There are no folders or files in it...

Scratch pictures are mostly used to create other basic images. For example, the debian image is created from the ground up like follows:

FROM scratch
ADD rootfs.tar.xz /
CMD ["bash"]

All of the system files are contained in rootfs.tar.xz. The filesystem directories are added to the scratch image, which is currently empty, by the Debian image.

The scratch image is completely empty. The hello-world executable included in the scratch image is statically compiled, which means it is self-contained and doesn't require any external libraries to run.

answered Apr 27, 2022 by Abhijeet
• 180 points

edited Mar 5

Related Questions In Docker

0 votes
3 answers

What is the difference between a Docker image and a container?

Images are read-only templates that contain a ...READ MORE

answered Aug 10, 2020 in Docker by Vishal
• 260 points
6,914 views
+1 vote
1 answer

What is a docker file? How do I create a docker image with dockerfile?

 A Dockerfile is a script/text configuration file that contains ...READ MORE

answered Jun 7, 2019 in Docker by Sirajul
• 59,230 points
4,774 views
0 votes
1 answer

What is the difference between “expose” and “publish” in Docker?

Basically, you have three options: Neither specify EXPOSE nor -p -> ...READ MORE

answered Jul 18, 2018 in Docker by Nilesh
• 7,060 points
3,521 views
0 votes
2 answers

Why is docker image eating up my disk space that is not used by docker

Move the /var/llib/docker directory. Assuming the /root directory has enough ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 7,060 points
1,953 views
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,863 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP