at 14:10 if it is not letting you build, try logging into your docker account by copy and pasting "docker login" in the terminal and then typing in your username and password. Password will be invisible as is normally the case so don't freak out if you cannot see the text.
Interesting , I used ChatGPT today and within 30 mins created images from my scripts, containerized in docker and monitor with portainer if needed. :D Never heard of this VScode before today haha.
Thanks for this well done video for first steps. You got a new sub! I'd love to have seen a followup video that explains how to update your code in the docker image and install python dependencies as well.
Excellent video! Thanks! Been looking for this for ages but that is not the reason why I watched this video. I thought there was a way to write a program outside a docker container and run that same code in a linux environment of docker container despite being on windows.
Great video, very helpful. Solved alot of the problems I encountered prior. But I have few question regarding VS, why did you run VS in ubuntu(wsl), you can still do the rest while running VS in windows like Docker: workspace ect.. . Also Is it better to allow your container to keep running, for example if you use -jupyter version of images your container will never stop running. though I want to avoid using jupyter, I still wonder if leaving your container running yields different results when debugging?
Hi, Christian.... thanks for this, wish I had seen it when I got started. I was particularly interested in the ability to create containers using VSCode tasks. You might be interested in API Logic Server - it creates executable web app projects from a database, including support for developing in docker, and creating docker containers.
For this video I was using powerlevel10k now I’m using a different app called starship but that’s how you customize your terminal. Made several videos about it :)
Thanks for the tutorial. I wasn't able to run the docker container though as my repository didn't have a name created automatically. it just said . Do you know what I did wrong?
While this simple tutorial worked well for me, trying to use docker-compose was bad - particularly bind-volumes just doesn't mount in vscode, while they work fine when using terminal docker-compose. But even just getting as far as launching the compose files was hard, and I had to research a lot and tweak launch.json and tasks.json a lot. Why doesn't vscode enable launching the composes, when it generates them??? So I vote YES, if you want to show how to make debugging docker-compose work ... AND bind-volumes! (I am on Fedora, and I am used to Pycharm).
Hello and thank you for posting. I am not very tech savvy, so perhaps you said this but I missed it, but we then have to run python INSIDE Of docker, correct? How do we do that? is there a line(s) in CMD? Thanks
Is there a way to mount host directories in the docker container? I have been searching for how to do this, but all I have pulled up is how to do it with "devcontainer.json." The process you showed in your video seems different for some reason.
slightly expanded this example in python to output/print to a file. Any ideas how I would be able to save this output file to host machine, rather then container
Nice video, just don't get it why you recommend ubuntu. In my experience the ubuntu mother, being Debian is much more stable, even if you use the testing branch.
My experience is that Ubuntu is pretty stable as well, but you also get newer software packages. I'm not 100% happy with Ubuntu either, but for a beginner it's definitely the best distro to start with (in my opinion 🤣)
Hi, thanks for this info! I have a question though, what if you are using a library like pandas or matplotlib and need the intellisense to autocomplete or easily access the description of methods that are in libraries that get loaded into the image - container but are not installed locally? I know you can attach to a running container, but when you are building a simple app in python the container stops running right after the script finishes. is there anyway to attach to a container that is stopped to get these features? or the only solution is to install the libraries locally? thanks!
@@christianlempa thanks for the answer, i just came up with installing libraries locally, couldn’t find a way to get that with a stopped container. If you ever get a solution I’d be very happy heje
Hello Christian. I am now starting to get into docker and I have a question. Aren't 116 MB for running a simple python application too much? I think most of this space is the debian image that we are using to run the python script on. Wouldn't be more space efficient to not have an entire os image to run the script? Like having only the python bin in the container? Is this possible?
I have the problem that when I try to add and import a module, say "import numpy as np" it tells me that Pylance is not finding it. Any tips on how to fix that?
Now when Docker Desktop costs money. Do you have any good solution on how to create a docker image without using a build pipeline? Is there any good way to do this on windows using WSL?
@@christianlempa ya i know. Bit i want it for fast test builds in my company. I can do it via azure devops pipeline but it is alot more work to setup for a fast test. Thx anyway.
To give Internet access for my container, I just need to add - -net=host right? How about give access of my host webcam to my container? My container python script uses opencv lib
Hi there, I tried to do the same with another python code, but when i run the image through the terminal, I get a /bin/sh: 1: [python,: not found error. Can you please help me out with this? Thanks.
Sorry for late response. Seems like your Docker container hasn't installed Python. So maybe check your image version if everything is installed there, otherwise use another image that has Python installed.
That's so helpful!!! I'm a total beginner and it really helped me step by step to build my first docker image!! Thank you!
This worked nicely for me.
Thank you for a good tutorial.
Being able to debug inside a container is a great feature.
at 14:10 if it is not letting you build, try logging into your docker account by copy and pasting "docker login" in the terminal and then typing in your username and password. Password will be invisible as is normally the case so don't freak out if you cannot see the text.
A very goog starting point for beginner - short and informative - please provide something similar about Python and docker compose 😀
This is the lecture I were looking for last 7 days! Thanks.
Awesome, glad I could help :)
I kept getting stuck on the debug part inside of the container within VS Code - thank you for being so informative!
came across you on Network Chuck. Great stuff, thank-you!
I was confused how to handle with Docker , but this tutorial was realyyyyyy helpful THANK YOU SIR :)
Thank you so much 😊
Interesting , I used ChatGPT today and within 30 mins created images from my scripts, containerized in docker and monitor with portainer if needed. :D Never heard of this VScode before today haha.
Thank you keeping the python example simple.
You're welcome!
Thank you very for clarifying basic concepts of docker.
Glad it was helpful!
Very informative and just what i was looking for. Thanks & subbed! :)
Thanks mate
Thanks for this well done video for first steps. You got a new sub! I'd love to have seen a followup video that explains how to update your code in the docker image and install python dependencies as well.
Thanks 😊
Great video. I wasn't using VSCode. I had to build the container again without the non-root user because the sqlite3 database I had was read-only.
Thank you!
Excellent excellent content.Thanks for sharing your knowledge.
Thank you so much for the great feedback :)
Yo Chris this is lit! Thanks 😎👍
keep it up, love the videos
Fast and clear, thank you very much.
Thanks , this simplified everything.
Great to hear 😉
@ChristianLempa. Thank you for your tutorials. Could you please share what type of lights do you use for your room background? Thank you.
Really great video. Thank you
Glad you liked it!
vs code has since changed a few times so this video just serves to compound the annoyance with building on microsoft
Thank you Christian!
Excellent video! Thanks! Been looking for this for ages but that is not the reason why I watched this video. I thought there was a way to write a program outside a docker container and run that same code in a linux environment of docker container despite being on windows.
Thanks for this video. Very useful
You're welcome
This is great bruh!
yes, would like to learn more about docker image pls
I can't Thank you enough ,you just solved my problem
Happy to help
Great video, very helpful. Solved alot of the problems I encountered prior. But I have few question regarding VS, why did you run VS in ubuntu(wsl), you can still do the rest while running VS in windows like Docker: workspace ect.. . Also Is it better to allow your container to keep running, for example if you use -jupyter version of images your container will never stop running. though I want to avoid using jupyter, I still wonder if leaving your container running yields different results when debugging?
Hi, Christian.... thanks for this, wish I had seen it when I got started. I was particularly interested in the ability to create containers using VSCode tasks.
You might be interested in API Logic Server - it creates executable web app projects from a database, including support for developing in docker, and creating docker containers.
Thanks I will have a look ;)
@@christianlempa are you in code spaces beta?
How come your terminal at 5:27 and 5:38 is so fancy? How can I get the same termimal you use?
For this video I was using powerlevel10k now I’m using a different app called starship but that’s how you customize your terminal. Made several videos about it :)
Thanks for the video.please may I know how to get the different colors for the different indentation like at 16:54
Waiting this video, thank you Christian! How about FastAPI ?
Thank you 😊, FastAPI needs to wait a little bit
Compose video?
Thanks for the tutorial. I wasn't able to run the docker container though as my repository didn't have a name created automatically. it just said . Do you know what I did wrong?
I need to access my csv file for pyspark task. What do I do to make my local drive accessible?
How can I set my docker container to an already built one? Can I avoid rebuilding the container each time I run debug?
While this simple tutorial worked well for me, trying to use docker-compose was bad - particularly bind-volumes just doesn't mount in vscode, while they work fine when using terminal docker-compose.
But even just getting as far as launching the compose files was hard, and I had to research a lot and tweak launch.json and tasks.json a lot. Why doesn't vscode enable launching the composes, when it generates them???
So I vote YES, if you want to show how to make debugging docker-compose work ... AND bind-volumes!
(I am on Fedora, and I am used to Pycharm).
Hello and thank you for posting. I am not very tech savvy, so perhaps you said this but I missed it, but we then have to run python INSIDE Of docker, correct? How do we do that? is there a line(s) in CMD? Thanks
Hey mate, yeah you can run a CMD inside docker that executes the python3 command, just like on the terminal
Is there a way to mount host directories in the docker container? I have been searching for how to do this, but all I have pulled up is how to do it with "devcontainer.json." The process you showed in your video seems different for some reason.
very good
Thanks
slightly expanded this example in python to output/print to a file. Any ideas how I would be able to save this output file to host machine, rather then container
Nice video, just don't get it why you recommend ubuntu. In my experience the ubuntu mother, being Debian is much more stable, even if you use the testing branch.
My experience is that Ubuntu is pretty stable as well, but you also get newer software packages. I'm not 100% happy with Ubuntu either, but for a beginner it's definitely the best distro to start with (in my opinion 🤣)
Hi, thanks for this info! I have a question though, what if you are using a library like pandas or matplotlib and need the intellisense to autocomplete or easily access the description of methods that are in libraries that get loaded into the image - container but are not installed locally? I know you can attach to a running container, but when you are building a simple app in python the container stops running right after the script finishes. is there anyway to attach to a container that is stopped to get these features? or the only solution is to install the libraries locally? thanks!
Good question, I haven't really looked into that to be honest.
@@christianlempa thanks for the answer, i just came up with installing libraries locally, couldn’t find a way to get that with a stopped container. If you ever get a solution I’d be very happy heje
How can I do it if I have an input variable in the python script. please let me know. Thanks in prior.
Hello Christian. I am now starting to get into docker and I have a question.
Aren't 116 MB for running a simple python application too much?
I think most of this space is the debian image that we are using to run the python script on.
Wouldn't be more space efficient to not have an entire os image to run the script?
Like having only the python bin in the container? Is this possible?
There are much more lightweight and smaller images of containers available. Take a look at alpine images f.e.
Because i was curious aswell: As he stated, alpine is really lightweight in terms of size. To be more specific 5MB
I have the problem that when I try to add and import a module, say "import numpy as np" it tells me that Pylance is not finding it. Any tips on how to fix that?
Now when Docker Desktop costs money. Do you have any good solution on how to create a docker image without using a build pipeline? Is there any good way to do this on windows using WSL?
You can still use Docker Desktop for personal use, so I don’t have an issue with it
@@christianlempa ya i know. Bit i want it for fast test builds in my company. I can do it via azure devops pipeline but it is alot more work to setup for a fast test. Thx anyway.
Hi, can anyone help me, I'm wrote my python code(for desktop app) in pycharm, I want to upload it to Microsoft, what steps should I follow?
Will the files persist when you stop the containers?
To give Internet access for my container, I just need to add - -net=host right? How about give access of my host webcam to my container? My container python script uses opencv lib
You containers have internet access, also if they're bridged. You usually don't need to add the net=host setting.
is there a way to change the code and run again without building the entire container ?
Shouldn't you configure the python interpreted somehow to point to the docker container?
do you have a version for Mac?
Ist ein "Remake" des Videos mit vscode dev containern geplant?
Hi, eher nicht da die Programmier Videos nicht so gut ankommen leider :(
@@christianlempa zweitkanal 😉
Hi there, I tried to do the same with another python code, but when i run the image through the terminal, I get a
/bin/sh: 1: [python,: not found
error. Can you please help me out with this? Thanks.
Sorry for late response. Seems like your Docker container hasn't installed Python. So maybe check your image version if everything is installed there, otherwise use another image that has Python installed.
It doesn't create settings.json when I create new python file on vscode
Can't install Ubuntu 20.04 LTS what to do?
thank you
You're welcome
there is no vscode when json settings when i refresh
Hey Chris. Great Video. How do I deploy my container after I am done with development?
Thanks mate! Check out some Docker Tutorials on my Channel, that will exactly tell you how ;)
@@christianlempa Figured it out 😁
It's not pronounced "interpreTTer", but more like "interpretoerh". ;-)
;D
pywin32 will not work with this. No real solution
Ha sorry, I tried, but Windows... I can't.
Auf Deutsch bitte. Gern geschehen
Nein Danke