I was just about to comment how great this video is and I saw I commented the same a year ago 😂 Thanks again. Now I'm a senior developer and these things keep been high value.
I wanna thank you for aaaaalll the videos you share with us. Me, as a non-english-native person, I appreciate the rythm and accent in your voice, so we can understand exactly what you are saying. Also,, the explanation is very clear !! Thank you so much!!!
Thank you Patrick! This was one of the clearest, straight-forward and concise introductions to Docker for people who actually do development and not just devops/admin stuff. Very helpful!
Amazing explanation. Even though my native language is not English, this is the best tutorial I've found and the one that I understood the best. Thanks!
Devcontainers have prebuilt configurations that are *much* simpler and gives your container superpowers with devcontainer feautres (like docker-in-docker)
Yes, using non-dev images like he showed is an awful dev experience. Much better to use the premade ones for development, and then custom dockerfiles just for final testing and deployment.
Good tutorial! If anyone on Windows using Git bash having problems to see the reload of the local code, try mounting the volume with: -v /${PWD}:/code Apparently there is a POSIX path conversion that doesn`t convert correctly and ends up adding a ";C" at the end of the local path
This is the video that has finally got me over the line for using Docker. I needed to upskill this for work, my sincerest gratitudes to you. Thank you so much.
Very interesting video. Although it lacks some clarifications on the docker commands, this gap could be filled by ChatGPT helping me out understand what they were exactly. Thanks for the video
7:17 Having a list of strings is a good idea. This avoids having to pass a shell command, with all the possibilities for (mis)interpretation of special characters. Instead, you pass the command-line words directly to the program, as is.
2:13 A container is actually _less_ than a whole VM. It’s a complete prepackaged userland, that runs under the same Linux kernel that is already installed on your machine. It is not actually an OS on its own.
In the moment of mounting the outside Volume, there should be similar code inside the container. (We know this, as we were able to run it without mounting the outside code.). I miss some words, how this conflict is solved. * What happens to the code inside the container when editing the mounted code? * Why do we copy the code at all, if we plan to mount it? * Wouldn't it make sense to throw an error message from inside, similar: "Error 501: The source volume was not mounted"? Otherwise duplicated code may lead to many mistakes by editing the wrong place. * Is there any standard or practice, how to handle this?
> What happens to the code inside the container when editing the mounted code? it is substituted with anything new in project directory. > Why do we copy the code at all, if we plan to mount it? to be able to share it. You can commit all editing done to update the image.
is this different for Flask? Also could you show how to deploy a CNN model and make it work? how do you post an image to trigs the app? do you include the CNN model (sometimes it is heavy) into the image? what if it is big size? Bests
brilliant tutorial! thank you I have a question.. I’m confused with how to debug worker command inside docer container, when it possible to run in bash console only? I’m going to be glad hearing your answer)
hello , as I know that docker volumes map the local machine folder Linux or MacOs is different to window 10/11. in windows 10/11 cannot be directly mapped to a local directory
Hi, Thanks for this tutorial, it's great! I would like to do the same in pycharm - but it appears that docker-based envs are a premium-only feature. Is that correct or it's possible to do the same also with the community edition of Pycharm?
Thanks for the indepth, yet easy to follow-along tutorial. However, I guess that there has been some updates in Docker network as the connection to Redis server does not work. Has anyone run in to same issues and are there any pointers for solutions?
Not sure what you mean, but you need multiple separate dockerImages, each for a different process, and then docker compose to organise all the different dockerImages you have, and run them all at the same time
Great video. Thank you for this fast foward track on "docker developing". But I have one stuoid beginner qestion: How do I get my changed code from inside the container? 🤔
You can always copy the code from the container. But in the video he is explaining about container volumes, which will mirror both local and the container code, so whatever is changed in the code of the container it will be mapped to the local code
Great tutorial. Is anything additional required when docker compose yaml references multiple containers forming a network? Can I just connect to my UI container and debug through all the other referenced containers as if they were just imports and I had justmycode set to false? Or do we need to edit other container docker files... Maybe adding port 5678 for example?
Great tutorial and cool way to leverage containers! Have you found any methods for doing this using open-source or even source available tooling? :-/ Microsoft appears to have restricted the Docker and dev-environment extensions to their proprietary closed-source release of vscode (Microsoft visual studio code)... Great to see Microsoft back to their old tricks 😩
Question: when you directly connected the IDE inside the cotainer, do you still need the mapping, since you are already in the IDE inside the container?
you probably still also want it on your machine and need a mechanism to persist the changes. But if, let's say you push your code from the container to Github, then you don't need the mapping
I'm not a C# dev, but you could probably modify the Dockerfile to pull the image for the current .NET version and then RUN any commands to set up the environment. Then you could modify the docker-compose file and replace the redis service with a SQL Server or MySQL one. Forward the appropriate ports, make sure that your volumes are correct, and you should be good to go. I'm sure there are plenty of resources out there to get you going. Good luck!
When using this approach you end up with 2 VScode projects open at the same time. And for some reason I can connect to debugger only from host VScode and not from container.
19:24 It is a pity you use exactly that filename in the tutorial that was non-compliant with the recommendations in YAML FAQ, in the first place and that has been replaced years ago.The recommended extension for YAML files has been `.yaml` since 2006. Docker-compose started with docker-compose.yml, but switched to using docker-compose.yaml several years ago, and now uses `compose.yaml` in the documentation (still falling back to the other formats, for those that have not read the manual recently)
thanks Patrick, am I the only one who's not getting anything when i run the command "docker run --name docher-container -p......". I've changed the port though to 8000:8000 due to an error on 80 but the localhost isn't accesible, any idea where i could be wrong please
Can you provide an update on using podman or containerd? My company has prevented us from using Docker due to corporate licensing costs. I am using virtualbox/vagrant now, but do not like the "integration" of vagrant into virtualbox
@@mpsii I think you didnt understand me, docker engine is free even for companies, just docker desktop (gui app) isnt, these arent the same things, CLI versions policy hasnt been changed. Read the docker subscription model on their official site. I even checked with my company, as we had the same situation, and I got green light after this explanation.
Ah I get it, sry I misunderstood you. Company isnt using docker anymore as a tool in general and you dont get anything by installing it on pc. Sry again, was just tryin to help :)
Something I don't understand. Why do we need to copy the code to the container if we are later mounting pwd to the container? The code which is in the image is not used anyway right? Also how does it work without EXPOSE 80 in the Dockerfile? Is it optional?
I am quite new to docker. In the example at 21:00, there is a duplicate in command (Dockerfile and docker-compose), should it be duplicated like that or not?
I have been using docker compose for project setup for years now and have been happy with it. However, as soon as I switched to an M1 Macbook, startup speeds have been pretty bad.
That is cool to have all your dev workflow as Dockerfile and to build it whenever/wherever you want. But it's such pain in the ass not to forget installing zsh shell, all vs code extensions, etc. Tried to set it all for my ml project, but failed.
I was wondering the same thing. When running in this setup what is the standard way to then use git? I assume it is to just install git inside the container and then go from there. You could install git with the Dockerfile (and maybe do some of the configuration) but it seems you would have to run through some of the git setup (such as auth with remote) everytime you rebuild the image? I would be very interested to hear what people do here?
Each time the container is rebuilt the editors extension have to be installed again. Here the workflow feels a little broken. Any best practice how to address with this? How to do it within a multi developer project?
Thanks for that tutorial sir 🔥 When I want to connect to my container throught Dev Containers, it opens the root folder instead of the code folder (thanks to workdir command in the Dockerfile), and I don't understand why.
Hi Patrick! I've been following you for a few months, and thanks for everything you share. Just a quick question, what do you use in the terminal of vs code that show you the suggested code? like autocompletion? thanks again :)
I love the powerlevel10k wizard, that asks you which features / settings you want. Much easier than trying to customize bash until it looks like Zsh with p10k.
would indeed be good to also for Pycharm. I am stuck with Pycharm because I always used it + I am also very much depending on its "on the spot autosave" functionality. In Visual code I dont have this feature undortunately (as far as i am aware)
I was just about to comment how great this video is and I saw I commented the same a year ago 😂 Thanks again.
Now I'm a senior developer and these things keep been high value.
😂😂😂😂😂😂
I wanna thank you for aaaaalll the videos you share with us. Me, as a non-english-native person, I appreciate the rythm and accent in your voice, so we can understand exactly what you are saying. Also,, the explanation is very clear !! Thank you so much!!!
Thank you Patrick! This was one of the clearest, straight-forward and concise introductions to Docker for people who actually do development and not just devops/admin stuff. Very helpful!
Amazing explanation. Even though my native language is not English, this is the best tutorial I've found and the one that I understood the best. Thanks!
Devcontainers have prebuilt configurations that are *much* simpler and gives your container superpowers with devcontainer feautres (like docker-in-docker)
Yes, using non-dev images like he showed is an awful dev experience. Much better to use the premade ones for development, and then custom dockerfiles just for final testing and deployment.
Can you give examples of good premade dev environment? anything for javascript?
@@Lexaire Can you give good examples of premade dev environment? one for javascript? thanks
agreed + you can actually debug in container (use break points )
@@Lexaireneed more!
A short and concise explanation of each point and very good examples. Thank you Patrick!
Thank you for this. Very comprehensible and through, ideal for a beginner tutorial.
For those who are asking about the VS Code theme, I believe it's 'Shades of Purple' by Ahmad Awais ⚡
Good tutorial!
If anyone on Windows using Git bash having problems to see the reload of the local code, try mounting the volume with: -v /${PWD}:/code
Apparently there is a POSIX path conversion that doesn`t convert correctly and ends up adding a ";C" at the end of the local path
you sir are a good man
Thanks bro I owe you a beer
Thank you brother - I almost gave up before I decided to search through the comments.
Or just stop using windows
This is the video that has finally got me over the line for using Docker. I needed to upskill this for work, my sincerest gratitudes to you. Thank you so much.
best on-point video I have seen in the last few months on YT.
आपके वीडियो सुपर कूल और अद्भुत हैं। मुझे यह बहुत पसंद आया. धन्यवाद
So far my favourite introduction to Docker. Thank you!
Awesome content and clear presentation; special thanks for the debugger setup!
Brilliant tutorial, concise yet very complete.
This is all I need and you gave it perfectly ! Thank you very much !
Thank you! Excellent video. Easy to follow.
Amazing tutorial. Fast and easy to understand.
Thank You so much Patrick for this vodeo, this was the much needed video for me right now
You’re a great teacher ❤ , thank you .
Thanks for the video. Just started the course on Docker so this one was extremely relevant
use podman instead, it is the future
Podman needs to fix few things, feature-wise, performance wise and bug-wise
Thank you very much, simple and easy to understand.
This is such a great video, thank you!
For those of you stuck at 12:18 take note that the brackets are curly brackets
yes curly brackets on windows power shell
Great Demo I even managed to to do it on my windows machine.
Superb. Thank you. This was very clean and straight to the point. Subbed.
Thank you for this great tutorial.♥
Hi Patrick, thanks for this great tutorial. Do you have any resources for setting up this environment with pycharm?
Very interesting video. Although it lacks some clarifications on the docker commands, this gap could be filled by ChatGPT helping me out understand what they were exactly. Thanks for the video
7:17 Having a list of strings is a good idea. This avoids having to pass a shell command, with all the possibilities for (mis)interpretation of special characters. Instead, you pass the command-line words directly to the program, as is.
Dear Patrick, thanks a lot for the great tutorial !!!
Wow i wanted to learn Docker!
Thx again Patrick!
Good Job! Amazing tutorial, Patrick. Thanks a lot!
2:13 A container is actually _less_ than a whole VM. It’s a complete prepackaged userland, that runs under the same Linux kernel that is already installed on your machine. It is not actually an OS on its own.
In the moment of mounting the outside Volume, there should be similar code inside the container. (We know this, as we were able to run it without mounting the outside code.). I miss some words, how this conflict is solved.
* What happens to the code inside the container when editing the mounted code?
* Why do we copy the code at all, if we plan to mount it?
* Wouldn't it make sense to throw an error message from inside, similar: "Error 501: The source volume was not mounted"? Otherwise duplicated code may lead to many mistakes by editing the wrong place.
* Is there any standard or practice, how to handle this?
> What happens to the code inside the container when editing the mounted code?
it is substituted with anything new in project directory.
> Why do we copy the code at all, if we plan to mount it?
to be able to share it. You can commit all editing done to update the image.
Thank you for the amazing tuto
thanks patrick , you are a genius!
Great video and impressive understanding of the subject matter.
Great explanation! thank you for your work
Hey Patrick,
Thanks for the video.
Do you know if developing inside docker Container is working With the community Edition of pycharm?
Very detailed! Cool stuff!
is this different for Flask? Also could you show how to deploy a CNN model and make it work? how do you post an image to trigs the app? do you include the CNN model (sometimes it is heavy) into the image? what if it is big size? Bests
this is literally a full course in 29 minutes! AMAZING :)
Excellent tutorial!
Thanks a lot for the great, short and to the point video with excellent explanations!
Thank you so much for sharing this with us ❤️🔥
Brilliant! Thank you for this video
Awesome tutorial
Interesting, you are using Fastapi. How can you debug with debugpy Flask application in docker since you need to give security PIN?
Great one!❤🔥❤🔥❤🔥
brilliant tutorial! thank you
I have a question.. I’m confused with how to debug worker command inside docer container, when it possible to run in bash console only?
I’m going to be glad hearing your answer)
hello , as I know that docker volumes map the local machine folder Linux or MacOs is different to window 10/11. in windows 10/11 cannot be directly mapped to a local directory
great video, thanks! a lot of value for 30 minutes !!
Nicely done 🎉
Hi, Thanks for this tutorial, it's great!
I would like to do the same in pycharm - but it appears that docker-based envs are a premium-only feature. Is that correct or it's possible to do the same also with the community edition of Pycharm?
Buenisimo!
1st: pwd & cwd are different
2nd: doesn't install redis in the current container but starts a different container
Very helpful sir!
exactly what i needed
Thanks for the indepth, yet easy to follow-along tutorial. However, I guess that there has been some updates in Docker network as the connection to Redis server does not work. Has anyone run in to same issues and are there any pointers for solutions?
Nice exploration! But could you do the same using just a docker-compose? Why do you prefer the way using Dockerfile? What benefits does it have?
Not sure what you mean, but you need multiple separate dockerImages, each for a different process, and then docker compose to organise all the different dockerImages you have, and run them all at the same time
Super, thanks a lot!
Great video. Thank you for this fast foward track on "docker developing".
But I have one stuoid beginner qestion: How do I get my changed code from inside the container? 🤔
You can always copy the code from the container. But in the video he is explaining about container volumes, which will mirror both local and the container code, so whatever is changed in the code of the container it will be mapped to the local code
Great tutorial. Is anything additional required when docker compose yaml references multiple containers forming a network? Can I just connect to my UI container and debug through all the other referenced containers as if they were just imports and I had justmycode set to false? Or do we need to edit other container docker files... Maybe adding port 5678 for example?
Docker: make a solution that creates more problems
Great tutorial and cool way to leverage containers! Have you found any methods for doing this using open-source or even source available tooling? :-/ Microsoft appears to have restricted the Docker and dev-environment extensions to their proprietary closed-source release of vscode (Microsoft visual studio code)... Great to see Microsoft back to their old tricks 😩
Question: when you directly connected the IDE inside the cotainer, do you still need the mapping, since you are already in the IDE inside the container?
you probably still also want it on your machine and need a mechanism to persist the changes. But if, let's say you push your code from the container to Github, then you don't need the mapping
I see and thanks for the informative video!
@Patric - it will be a great learning video about the same subject but geared towards C# developers with either SQL Server as a backend or MySQL etc.
I'm not a C# dev, but you could probably modify the Dockerfile to pull the image for the current .NET version and then RUN any commands to set up the environment. Then you could modify the docker-compose file and replace the redis service with a SQL Server or MySQL one. Forward the appropriate ports, make sure that your volumes are correct, and you should be good to go. I'm sure there are plenty of resources out there to get you going. Good luck!
Great content dude 😎
At 12:46 when we attach volume - did main.py copied inside container according to Dockerfile instruction?
When using this approach you end up with 2 VScode projects open at the same time.
And for some reason I can connect to debugger only from host VScode and not from container.
19:24 It is a pity you use exactly that filename in the tutorial that was non-compliant with the recommendations in YAML FAQ, in the first place and that has been replaced years ago.The recommended extension for YAML files has been `.yaml` since 2006. Docker-compose started with docker-compose.yml, but switched to using docker-compose.yaml several years ago, and now uses `compose.yaml` in the documentation (still falling back to the other formats, for those that have not read the manual recently)
Why at 9:00 in Dockerfile wi didn’t have to use EXPOSE instruction?
Thank you ^^
Could we also setup the debugger with the suggested "fastapi" option of VSCode?
Sir, What python IDE and autocomplete extensions you have used in Intermediate Python Course ? Kindly share
It is the one that's included with the python extension in VSC (the Python extension Patrick showed us)
Thank you! :)
thanks Patrick,
am I the only one who's not getting anything when i run the command "docker run --name docher-container -p......". I've changed the port though to 8000:8000 due to an error on 80 but the localhost isn't accesible, any idea where i could be wrong please
When you build the release container for distribution, will it strip out the vs code stuff? Or do you have to do this manually or isnt that necessary?
You need just rebuild image with code updated. That's it.
Can you provide an update on using podman or containerd? My company has prevented us from using Docker due to corporate licensing costs. I am using virtualbox/vagrant now, but do not like the "integration" of vagrant into virtualbox
@@mspajic My company has said "No" to docker due to licensing for company (not personal) use.
@@mpsii I think you didnt understand me, docker engine is free even for companies, just docker desktop (gui app) isnt, these arent the same things, CLI versions policy hasnt been changed. Read the docker subscription model on their official site. I even checked with my company, as we had the same situation, and I got green light after this explanation.
Ah I get it, sry I misunderstood you. Company isnt using docker anymore as a tool in general and you dont get anything by installing it on pc. Sry again, was just tryin to help :)
Something I don't understand. Why do we need to copy the code to the container if we are later mounting pwd to the container? The code which is in the image is not used anyway right?
Also how does it work without EXPOSE 80 in the Dockerfile? Is it optional?
I am quite new to docker. In the example at 21:00, there is a duplicate in command (Dockerfile and docker-compose), should it be duplicated like that or not?
I have been using docker compose for project setup for years now and have been happy with it. However, as soon as I switched to an M1 Macbook, startup speeds have been pretty bad.
Is it because m1?
What have gone wrong?
Great beginner tutorial. Thanks for this.
That is cool to have all your dev workflow as Dockerfile and to build it whenever/wherever you want. But it's such pain in the ass not to forget installing zsh shell, all vs code extensions, etc. Tried to set it all for my ml project, but failed.
there is no git install in the container, how can I push to repo like that ?
I was wondering the same thing. When running in this setup what is the standard way to then use git? I assume it is to just install git inside the container and then go from there. You could install git with the Dockerfile (and maybe do some of the configuration) but it seems you would have to run through some of the git setup (such as auth with remote) everytime you rebuild the image?
I would be very interested to hear what people do here?
@@James-gr2ds ohh I did solved it by installing git when container is being created at first. It will work fine.
What about other langs like go or rust?? and it too much tied up with vscode? can we configure some other editors???
Each time the container is rebuilt the editors extension have to be installed again. Here the workflow feels a little broken. Any best practice how to address with this? How to do it within a multi developer project?
Yeah, such a bummer. You need to add some lines in Dockerfile for installing z-shell and vs code extensions.
What's the extension used that suggests full command in the terminal? seems pretty handy
I use zsh-autosuggestions, is this is what you are looking for
Probably some "AI" bs
is there a MERN /MEAN stack development machine for it
Just install the things you need for MERN / MEAN stacks on your pc directly, preferably on a different drive than the OS drive.
12:34 Does the COPY command in the Dockerfile become superfluous when you define a volume?
Only if you don’t want to actually use the docker image in any production environment.
A.M.A.Z.I.N.G.
Thanks for that tutorial sir 🔥
When I want to connect to my container throught Dev Containers, it opens the root folder instead of the code folder (thanks to workdir command in the Dockerfile), and I don't understand why.
I used to think docker is the way to go for disposable dev environments until I started using Nix and dev-shell…
Hi Patrick! I've been following you for a few months, and thanks for everything you share.
Just a quick question, what do you use in the terminal of vs code that show you the suggested code? like autocompletion? thanks again :)
try zsh
I love the powerlevel10k wizard, that asks you which features / settings you want. Much easier than trying to customize bash until it looks like Zsh with p10k.
If we specify which dockerfile to use in docker-compose why do we need to write command: again
will the source code be bundled with the image?
yey 🙃
Attaching to running container opens Vs Code on an empty folder. How to I fix this?
Click File > Open Folder... and select the folder
Hi Patrick, thanks a lot! I want same guide for PyCharm)
100% needed
Does pycharm even support this feature? It would be cool if they did, but I have no idea.
@@NostraDavid2 yes, but unfortunately its very complex and the guide isn't clear
would indeed be good to also for Pycharm.
I am stuck with Pycharm because I always used it + I am also very much depending on its "on the spot autosave" functionality. In Visual code I dont have this feature undortunately (as far as i am aware)