Tuesday, November 28, 2023

Docker 13 (Docker File)

 





Creating a docker file 

#This is a sample Image

FROM ubuntu

MAINTAINER DevOps-Team

RUN apt-get update

RUN apt-get install tzdata

EXPOSE 80

CMD [“nginx","-g","daemon off;"]


Next step is build

docker build -f dockerfile . --tag nginx123:1.23



















Let me run the docker File

docker run -idt --name 007 -p 80:80 nginx123:1.23

Let me  verify








You will be able to see that nginx service is started automatically





You can run by using the public ip address
























No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...