Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Docker Tutorials: Image – Creating a docker image using scratch

You can use Docker’s reserved, minimal image, scratch, as a starting point for building containers. Using the scratch “image” signals to the build process that you want the next command in the Dockerfile to be the first filesystem layer in your image.

There is a scratch image on docker hub, but it’s essentially just the canvas for creating base images, it’s essentially useless until you setup an OS and create a new image from it. you’ll likely never need to use it unless you’ve written your own operating system, as just about every existing platform is already present in some form or another as a base image for you to build upon.

The scratch image is the most minimal image in Docker. This is the base ancestor for all other images. The scratch image is actually empty. It doesn’t contain any folders/files …

The scratch image is mostly used for building other base images. For instance, the debian image is built from scratch as such:

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

The rootfs.tar.xz contains all the files system files. The Debian image adds the filesystem folders to the scratch image, which is empty.

While scratch appears in Docker’s repository on the hub, you can’t pull it, run it, or tag any image with the name scratch. Instead, you can refer to it in your Dockerfile. For example, to create a minimal container using scratch:

FROM scratch
ADD hello /
CMD ["/hello"]

Assuming you built the “hello” executable example from the Docker GitHub example C-source code, and you compiled it with the -static flag, you can then build this Docker image using: docker build –tag hello .

The scratch image is blank.The hello-world executable added to the scratch image is actually statically compiled, meaning that it is self-contained and doesn’t need any additional libraries to execute.

$ docker run --rm -it -v $PWD:/build ubuntu:16.04
container# apt-get update && apt-get install build-essential
container# cd /build
container# gcc -o hello -static -nostartfiles hello.c

Then you can run it (on Linux, Mac, or Windows) using: docker run –rm hello

There are more example scripts for creating parent images in the Docker GitHub Repo:

There are one very good reference of understanding and creating the docker images from scratch are

Rajesh Kumar