#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"
Смотрите видео Dockerfile | Build, Tag, Push | Build Own Image And Push To Docker Hub онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Thetips4you 27 Февраль 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 11,729 раз и оно понравилось 108 людям.