Docker + Python tutorial - Create and launch a simple container

preview_player
Показать описание
Hi everyone, in this tutorial I am going to show you how to create and launch a simple container using Python and Docker.

Useful Links:

Рекомендации по теме
Комментарии
Автор

Amazing video, I had some issues running on Windows.

The first one was running: docker build -t dockertutorial

Windows automatically converts any new file for .txt and you need to force docker to read it:

docker build -t test -f Dockerfile.txt .

I got the following warning:

SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

When I run docker run dockertutorial I got the following error: python: can't open file 'hello.py': [Errno 2] No such file or directory

To fix that you can add the COPY in Dockerfile:

FROM python:3


RUN pip install --upgrade pip && \
pip install numpy

COPY hello.py ./hello.py

CMD ["python", "hello.py"]


I've never commented on youtube channel before but you did a brilliant job and you deserved some good words.

I hope my comment can help other beginners.

Thank you for the video.

jaspinho
Автор

Awsome that is what i was looking for Thank you.

aqibfayyaz
Автор

Hello there... Nice video. Please I'm having trouble connecting the docker container to my host and writing to the python file from an external script from a web page. Can you help?

TechMond
Автор

I can't run the container on windows... [errno 2] No such file or directory :(

iHelperRo
visit shbcf.ru