Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Docker Tutorials: Image – Create a image using Dockerfile

We learnt docker so we can create better docker images using dockerfile?

What is dockerfile?

- a file
- contains instructions
- for writing each layer
- multiple layers == one image

Rule of dockerfile?

  • each line ==== one layer
  • Each layer would be created from a container from the previous layer

Example of Dockerfile


FROM ubuntu
MAINTAINER Rajesh Kumar <rajesh@devopsschool.com?
RUN apt-get update
RUN apt-get install git -y
COPY index.html /optCode language: JavaScript (javascript)

FROM ubuntu
MAINTAINER Rajesh Kumar <rajesh@devopsschool.com?
RUN apt-get update
RUN apt-get install git -y
COPY index.html /optCode language: JavaScript (javascript)

FROM httpd
MAINTAINER Rajesh Kumar <rajesh@devopsschool.com?
RUN apt-get update
RUN apt-get install git -y
COPY index.html /optCode language: JavaScript (javascript)

   15  mkdir dock-image
   16  cd dock-image/
   17  clear
   18  vi dockerfile
   19  touch index.html
   20  docker build -t ub-up-git .
   21  docker images

Lab & Excercise

- https://devopsschool.com/tutorial/docker/dockerfile/dockerfile-example-sample-lab.html

Example of App Dockerfile
# https://github.com/jenkinsci/docker/blob/587b2856cd225bb152c4abeeaaa24934c75aa460/Dockerfile
# https://github.com/tianon/docker-brew-ubuntu-core/blob/50b110c15148c069706b155a60d21ecfcbb59de9/focal/Dockerfile
# https://github.com/docker-library/httpd/blob/6d68525ac47c0474d3d74269b2669104c1d867dd/2.4/Dockerfile

How to set PID1 for the image?
- CMD or ENTRYPOINT

Reference 
- https://devopsschool.com/tutorial/docker/commands/index.html
- $ docker help
Code language: PHP (php)

Reference

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Docker Tutorials: Docker Image – Understanding Dockerfiles instructions & options

Hereโ€™s a step-by-step tutorial for Dockerfile, including explanations and examples for each major command. Dockerfile Tutorial A Dockerfile is a text file containing instructions to build a…

Read More

Docker Tutorials: Docker Image – Example and Sample Programs of Dockerfile

Reference Rajesh Kumar Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories…

Read More

Docker Tutorials: Installation and Configurations

Docker Installation in Centos/RHEL Method -1: How to install Docker Community Edition via YUM? Step 1 – Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data…

Read More

Docker Tutorials: How to Install Docker in Ubuntu?

Install Docker Engine in Ubuntu NOTE – All commands you must run as root user or add a current user into a linux group name called “docker”…

Read More

Docker Lab, Excercise & Assignment – 7 – Docker Volume

Below is a very detailed tutorial and lab manual for learning Docker Volumes, using the Ubuntu image for practical, hands-on labs. This covers all major types of…

Read More

Docker Lab, Excercise & Assignment – 4 – Docker Networking

Hereโ€™s an in-depth, step-by-step tutorial and lab manual for Docker Networkingโ€”starting from basics, covering all core concepts, and providing a hands-on guide to every feature and command….

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x