How to Create a Container From Our Own Image (Method-2)

Share via:

How to Create a Container From Our Own Image (Method-2)

In this article,we will see Create a Container From Our Own Image.

What Are Containers?

Container is considered a new method that can replace virtualization.
An operating system can operate many applications from the cloud. Instead of virtualizing the computer as with VM, containers virtualize the OS.
Containers are placed on a physical server and host OS.
Shared components are read-only.
Every container shares kernel, binaries, and libraries with their host OS.
These shared components are available only as read-only, so there is no need to reproduce operating system codes.
The server will be able to run a lot of workloads in just one OS installation.

Steps to Follow

  1. Create a container “kt-container”.
  2. Create a new file “ktexpertsfile” inside the container.
  3. Verify Changes (what you have done).
  4. Create a image from the above container “kt-container”.
  5. Create container “kt1-container” from image “kt1-image”.

1. Create a container “kt-container”

To see the OS related files of the container

To see the OS information of the container

2. Create a new file “ktexpertsfile” inside the container 

Exit from the container

3. Verify Changes (what you have done)
Use below command to show the things what changes you have done in the contianer
C — Change
A — Add

4. Create a image from the above container “kt-container”
we can create image in 2 ways
Create from image container and give name to created image.
Give name while creating the image
Create image container and give name to created image
Create image from container

To see the list of images

Give name to the above image

Verify the image
To see the list of images

Give name while creating the image

Verify the image
To see the list of images

5. Create container “kt1-container” from image “kt1-image”
To see all the containers

Run below command to create a container 

Verify file “ktexpertsfile ” inside the container

Exit from the container

Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates

KTEXPERTS is always active on below social media platforms.

 

Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

Add Comment