HomeVideoDockerfile | Build, Tag, Push | Build Own Image And Push To...

Dockerfile | Build, Tag, Push | Build Own Image And Push To Docker Hub


#Docker, #Containers, #Dockerfile Hello Friends, This video will give you the complete details on how to create a docker image from docker file, build the image using tag and push the image to docker hub repository.

we are going to use python base image and build a customized image which will run a python script when the container is running.

Dockerfile and Push docker image to Dockerhub

FROM python:latest

ADD Square.py /

CMD [“python”, “./Square.py” ]

docker image build -t pythonsquare:0.0.1 /root/docker

Ref: https://www.geeksforgeeks.org/program-to-print-hollow-rectangle-or-square-star-patterns/

# Python 3 code for hollow rectangle

# Function to print hollow rectangle
def print_rectangle(n, m) :

for i in range(1, n+1) :
for j in range(1, m+1) :
if (i == 1 or i == n or
j == 1 or j == m) :
print(“*”, end=””)
else :
print(” “, end=””)

print()

# Driver program for above function
rows = 6
columns = 20
print_rectangle(rows, columns)

Docker login

docker push thetips4you/pythonsquare:0.0.1

Docker logout

=================================================
Follow me @:
https://www.instagram.com/thetips4you
https://www.youtube.com/channel/UCoOq
https://www.facebook.com/thetipsforyou
http://www.thetips4you.com
======================================================

Note: Each word by Word or sentences used in this video is self written and converted to Audio to give explanation on the steps in each tutorial . These are not automated or third party content or scrapped from any website.
Music credit: “Royalty Free Music from Bensound”

View it at Youtube

Most Popular