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

Published: 27 February 2020
on channel: Thetips4you
11,729
108

#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...


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 @:
  / thetips4you  
https://www.youtube.com/channel/UCoOq...
  / 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"


Watch video Dockerfile | Build, Tag, Push | Build Own Image And Push To Docker Hub online without registration, duration hours minute second in high quality. This video was added by user Thetips4you 27 February 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11,729 once and liked it 108 people.