How to run python code in Docker

Very simple question, but surprisingly I couldn’t find answer for hours.

This is because most tutorials show how to run python code like: print(“Hello World!”).
These codes require few or no packages.

But there is no good tutorial that show how to run python codes that require many packages.
Even the few tutorials that cover them lack most important contexts, like how to correctly get requirements.txt or environment.yml. Some were even outright wrong, as requirements.txt didn’t have all required packages(due to conda install instead of pip, etc)

I only want to know how to run my python code in docker.
Simple question, but answer will help me a lot!
Thanks :slight_smile:

Hello

I already write posts on that topic.

Very straight forward : Play with Docker and Python | Christophe Avonture

Another post if you are under Windows : Docker - Easy setup of Python under Windows | Christophe Avonture

1 Like

Is there a tutorial for running python code more complicated than print(“Hello World!”)?
Thanks!

It seems you have just read the first article, not the second.