My Favorite Way To Handle Dev Environments | VS Code Devcontainers

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น •

  • @such-ej
    @such-ej ปีที่แล้ว +60

    It was an impressive video. The length of 30 minutes may be confusing at first, but it's worth watching. Everything is explained in an accessible manner, logical and consistent. If all tutorials were at this level, we would live in a different, better world.

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว +4

      Thanks for the kind words!

    • @quemsoueu3
      @quemsoueu3 ปีที่แล้ว +1

      i agree 100%!

  • @makoswebdev7382
    @makoswebdev7382 ปีที่แล้ว +7

    Dan, your video was a lifesaver! I spent the entire day wrestling with the slow system problem you've mentioned , only to discover through your tutorial that the root of my troubles was cloning the repo into my local Windows file system. Your guidance was invaluable - thank you once more.

  • @brianvarren
    @brianvarren ปีที่แล้ว +16

    Thank you for leaving the errors and solutions in. I also appreciate the somewhat informal style, it's like getting help from a friend, vs sitting in an overcrowded lecture hall. I learned a lot. Subscribed.

  • @NelCapeTown
    @NelCapeTown ปีที่แล้ว +3

    So happy when the TH-cam algorithm finds gold for me. It is easy to get sidetracked into how the Universe sends you information you request on a philosophical level, but this explanation is so exactly what I needed and it popped up in my feed rather than specific search results. Spot on. Looking forward to seeing your other work.

  • @ecofriend93
    @ecofriend93 8 วันที่ผ่านมา

    Hey Dan, thanks a bunch!! THE best explanation I've seen on how to set up a dev environment using docker in VS Code.

  • @rishabhsaxena9357
    @rishabhsaxena9357 ปีที่แล้ว +2

    Nice video!!
    I've some questions:
    1. How to share the dev container to a co-worker?
    2. If I add PostgreSQL as a database in my dev container, how will I access it using softwares like PgAdmin/Dbeaver?
    3. If I have my backend running on my local windows machine serving some APIs and my angular frontend application running in dev container, how will frontend communicate to the backend?

  • @Malix_Labs
    @Malix_Labs 10 หลายเดือนก่อน +1

    Perfect amount of edge-case covered, goated tutorial

  • @iotbits
    @iotbits 11 หลายเดือนก่อน

    Great tutorial, you explained all the steps, mostly tutors or experienced people assume the viewer knows some steps which is not always true, I appreciate your extra efforts explaining each step thoroughly. Thanks.

  • @clusterdriven
    @clusterdriven ปีที่แล้ว +1

    @DanCanCode, let's say you are in a devcontainer, you do some work, run git add, commit, and push. Now you realize your ssh keys are missing inside the container as they only exist in your local machine and thus you can't push code. How would you go around this issue?

  • @ksh6
    @ksh6 ปีที่แล้ว +2

    Excellent video. It explained everything I wanted to know about this in a simple way. You have perfect voice and talent for these type of videos. Keep making, your videos will go viral over time.

  • @devendrahaldankar8535
    @devendrahaldankar8535 5 หลายเดือนก่อน

    Subscribed! The simplicity in presentation, easy going nature, I loved most!

  • @detprest8975
    @detprest8975 ปีที่แล้ว

    Had to endure watching a few other videos before I found yours. Clear, indepth and Concise the 30 mins flew past..

  • @wattsfield1889
    @wattsfield1889 11 หลายเดือนก่อน

    Cool! I am totally looking deeper into Dev Containers to avoid installations pain for our team

  • @JamesQQuick
    @JamesQQuick 9 หลายเดือนก่อน

    Wow, I didn't know about this. Really cool!

  • @slowjocrow6451
    @slowjocrow6451 9 หลายเดือนก่อน

    Finally I understand why and how to use this stuff 😅

  • @ChrisCheng-en4nw
    @ChrisCheng-en4nw ปีที่แล้ว

    Such a performance of a fantastic tutorial!!! Good job! Please bring more and more videos like this one! Thank you so much.

  • @kenchang3456
    @kenchang3456 ปีที่แล้ว

    Way excellent video, thanks. I'm going to give it a try.

  • @deandunn206
    @deandunn206 ปีที่แล้ว

    Thanks for this, great overview of dev containers. Didn't know this existed! Will really help my workflow.

  • @SouhaibD
    @SouhaibD ปีที่แล้ว +1

    Clear and straight to the point. Thank you Dan!

  • @RajaSachithanantham
    @RajaSachithanantham ปีที่แล้ว

    Thank you, Dan, for this incredibly informative and detailed tutorial on setting up a development environment using Visual Studio Code's Dev Containers. Your explanations were clear and easy to follow, and I appreciate how you addressed the challenges of reproducing the environment and onboarding new team members. The step-by-step instructions, along with the demonstrations, made it much easier for me to understand and implement this approach. I also liked how you highlighted the customization options and the integration with GitHub code spaces. This tutorial has been incredibly helpful, and I'm excited to apply this knowledge to my own projects. Keep up the great work!

  • @mykola2173
    @mykola2173 ปีที่แล้ว

    This is magic! Exactly what I needed, thank you!

  • @mahsaamiri9243
    @mahsaamiri9243 6 หลายเดือนก่อน

    You explained it in an awesome way! Thanks

  • @EngineeringVignettes
    @EngineeringVignettes ปีที่แล้ว +1

    Thanks for the overview, it seems a good way to knock up a build environment if your needs can fit into a prebuild "canned" image.
    It seems it is running git operations in the container. How is it importing .git-credentials and .gitconfig into the container?
    On my hand-built containers i usually mount .gitconfig etc from my home dir and then I get access to those settings, PATs etc.
    It would also be interesting to see how the dev containers system overcomes the "docker user ID problem", we use a little trick on our containers to override the default user in the container with the outside user's uid (groupmod, usermod) when the container is first started..
    Cheers,

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว +1

      I think you can make custom Dockerfiles and use the system. I know you can modify them.
      It *might* be syncing git preferences through VS Code's GitHub sign in. I'm certain it's doing that for credentials. I haven't had to install the GitHub CLI or mess with persisting credentials on linux in all those other ways.
      Docs for how the user id thing is handled in devcontainers: code.visualstudio.com/remote/advancedcontainers/add-nonroot-user
      Love the Fallout vault boy avatar

  • @RonWaller
    @RonWaller ปีที่แล้ว

    New to docker containers and container development. Curious can you customize the linux environment to run like your "home" setup? (similar terminal setup etc etc), also Can you create a "template" dev container when created the based is the same every time? (sort of pertaining to my pervious question. As to not be spending time setting up the environment to your liking for each and every dev container). I sure hope you get what I meant. lo.

  • @videotalks
    @videotalks ปีที่แล้ว +1

    It was a wonderful video to learn about dev-containers. I'm a hobby developer and always into multiple projects with kinda same toolset. So, I was looking forward to getting another video from you where we can create one dev container in VS Code and use it for multiple projects? It would be a nice follow up to this one. Thanks.

  • @Adhocfan
    @Adhocfan 7 หลายเดือนก่อน

    great video. How would you do this for a nx monorepo that has 2 apps in side it with libs?

  • @digitaldisruptlabs
    @digitaldisruptlabs ปีที่แล้ว

    Very clear and easy to follow. You are also very engaging! Thanks

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      Awesome, thank you!

  • @geraldbullardjr
    @geraldbullardjr ปีที่แล้ว

    Very VERY cool explanation THANKS!!!

  • @aternous
    @aternous ปีที่แล้ว

    Hi, with the method, how do I close VS Code (and stop the container after having checked in) and come back later on and automatically have the container started for me where I left off OR quickly start things up with a simple command to get back to where I was? Do I have to clone each time? Cant I start the container and VS Code automatically jump to the session in the container? What's the quickest way to get back to the state I left the application?

  • @CryptoBuilders
    @CryptoBuilders 8 หลายเดือนก่อน

    Hey dan, if i configured already WSL2 and Ubunto on my widnows OS, wouldnt be better to install directly docker desktop for linux instead of windows version?

  • @fromnsk
    @fromnsk 4 หลายเดือนก่อน

    Cool stuff, thanks!
    But ChatGPT says the following about "Dev Containers: Open Folder in Container":
    When you use "Dev Containers: Open Folder in Container", VS Code is actually working directly inside the container's environment. This means:
    No Cross-Environment File Sync: You’re not syncing files between Windows and Linux; instead, you’re directly editing files in the Linux environment of the container.
    Performance: Since everything happens within the container, performance should not be significantly impacted. There's no constant file transfer between Windows and Linux because the file system you're working with is entirely inside the container.

  • @maqloch
    @maqloch ปีที่แล้ว

    Realy nice tutorial. Helped a lot! Cheers!

  • @Flackon
    @Flackon ปีที่แล้ว +1

    So, to share your custom environment with other team members you would share the .devcontainer directory? How does it work?

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      I usually commit it to version control. So it is included when someone clones the project repo.

  • @breezewang6344
    @breezewang6344 ปีที่แล้ว

    Thanks for this great video. May I know which extension you used to draw flow-chart at around 7:00 minute?

    • @soorbus
      @soorbus 4 หลายเดือนก่อน

      If you look right at the top of his screen, looks like he is using excalidraw

  • @dekooks1543
    @dekooks1543 ปีที่แล้ว

    This is top shelf stuff right there !!

  • @markortiz2679
    @markortiz2679 ปีที่แล้ว

    @DanCanCode, what happen if we need most updated version of java for example but the available base workspace is still using an old version, is there a way to tell devcontainer to use latest or different version of java? Thanks

  • @JeanPhilippeMaquestiaux
    @JeanPhilippeMaquestiaux ปีที่แล้ว

    Sometimes later... How do you specify the volume location e.g. /home/dev/projects/proj1

  • @rangue
    @rangue ปีที่แล้ว

    Very good! How do we share ssh key between the container and The host machine?

  • @mikevaleriano9557
    @mikevaleriano9557 ปีที่แล้ว +1

    a bit late, but how do you deal with updates to dependencies, how does it work?

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      Good question! Project dependencies are handled as normal, for instance you would run `npm install` in the terminal (it runs inside the container). If you update a dependency in the container's dockerfile, there's a command to rebuild the container. I think VS Code prompts you when a change is detected.

  • @phreakadelle
    @phreakadelle ปีที่แล้ว +3

    Nice video! Thanks! Inspired me to get all that WSL stuff right. WIthout that, the performance can be very underwhelming...

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว +2

      Glad it helped! Yeah it really can get slow across the filesystems. Underwhelming indeed

  • @marioarmagni6498
    @marioarmagni6498 ปีที่แล้ว

    uow, so good video! Thank you!

  • @jimmydfgh8805
    @jimmydfgh8805 11 หลายเดือนก่อน

    I am trying to build an image using docker and the dockerfile is in the directory. docker extension is already installed. But when I build, the command line says "bash: docker: command not found". I don't know whether it is an image problem, sometimes I don't have the issue and sometimes I do. Any suggestions?

    • @jimmydfgh8805
      @jimmydfgh8805 11 หลายเดือนก่อน

      Ah, I just discovered that Docker is not installed by default in the image and I need to install myself. And the docker extension is a different thing altogether. Thank you.

  • @exciteresearch
    @exciteresearch 7 หลายเดือนก่อน

    Hey Dan and Dan's community, I've been testing VSCode and Devcontainers in WSL/Docker for the last four days but I'm having a problem with "Build repository in devcontainer" using a Bitbucket Repository which hangs in the terminal when requesting permission to add the Bitbucket server to known_hosts. It just hangs and doesn't take the 'yes' keystrokes for input. Does anyone else have a solution?

  • @paulwozere
    @paulwozere 5 หลายเดือนก่อน +1

    These instructions no longer work. When I do the Clone it just asks me for the branch and then does nothing

  • @rujor
    @rujor ปีที่แล้ว

    Very nice walkthrough! It would be very useful to know how to setup container access to localhost, in cases where dev-servers (SQL/Redis etc.) are running there.

  • @ai.aspirations
    @ai.aspirations 2 หลายเดือนก่อน

    Awesome!!! Thanks much!!!

  • @ahmedelrewaidy6049
    @ahmedelrewaidy6049 ปีที่แล้ว +1

    Brilliant! Thank you.

  • @frankfu1122
    @frankfu1122 ปีที่แล้ว

    Thanks for sharing! I love it

  • @vitcosoft
    @vitcosoft 8 หลายเดือนก่อน

    Very helpful, thanks!

  • @rogalaharacz
    @rogalaharacz ปีที่แล้ว +1

    What is the zsh theme you're using?

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว +1

      It's called powerlevel10k ! github.com/romkatv/powerlevel10k

    • @rogalaharacz
      @rogalaharacz ปีที่แล้ว

      Thanks!

  • @speppucci
    @speppucci ปีที่แล้ว

    Awesome video, very clear!

  • @stuartbiggs1278
    @stuartbiggs1278 ปีที่แล้ว

    When I try to clone the container, I get an error message saying "error occurred setting up the container. Is there any chance that you could look into this please?

    • @rohansaibuddhi5280
      @rohansaibuddhi5280 6 หลายเดือนก่อน

      i get the same error, did you ever find a solution?

  • @艾曦-e4g
    @艾曦-e4g ปีที่แล้ว

    I have to say "thanks" for your excellent video, I love it. I think the default Linux repo is OK! But, I just want to use different tools such as zsh, bat, riggrep, etc. Maybe, we can use nix and flakes to provide more config options in the same image for different projects. Do you know something similar or how to achieve that goal? Thanks a lot!

  • @ChadE1020
    @ChadE1020 ปีที่แล้ว +1

    Thank you for showing this!!!!!!!!!!!!!!!......!!!!!!

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      I hope the feature helps!

  • @siddhartroy4409
    @siddhartroy4409 2 หลายเดือนก่อน

    Great video❤...

  • @mr_broombroom
    @mr_broombroom ปีที่แล้ว +1

    Awesome video!
    Is there a way to connect from vscode to the dev container again besides using opening the recently opened in the welcome screen? When I try to do so, I can't see the files.
    Also: do I have to clone again when I destroyed the container?
    Keep up the good work!

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว +2

      Try the Remote Explorer icon on the activity bar? I think it lists containers, code spaces, ssh connections.
      You may have to re-clone if you destroyed it in docker. You could still get to the files in the volume it mounted if still available.
      Closing the window or turning off the container is not the same as destroying it. Just in case, thought I'd mention.

  • @b1chler
    @b1chler ปีที่แล้ว

    cool video! thanks
    do you have experience with using it in a monorepo like turbo?

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      If the entire mono repo is in the container I think it shouldn't be any different. I do have a turborepo and sometimes use it in the dev container.

    • @b1chler
      @b1chler ปีที่แล้ว

      @@DanCanCode the monorepo isn't running one container but every app is running in a container. meanin a docker compose and several docker files.
      :)

    • @BTCruiser2011
      @BTCruiser2011 ปีที่แล้ว

      @@b1chler probably more complicated than it's worth then. Not sure how you'd get turborepo to communicate across the container boundary. I suppose you could try docker-in-docker, but sounds messy.

    • @pwii
      @pwii ปีที่แล้ว

      @@b1chler You just need to have docker installed in the devcontainer and add a bind mount to the host's /var/run/docker.sock. The containers will be created on the host machine, but you might need to do some setup with docker networks if the app containers need to be accessible from the devcontainer.

  • @marcjacobreyes
    @marcjacobreyes ปีที่แล้ว +1

    Great Video

  • @abdullahalrashidi497
    @abdullahalrashidi497 ปีที่แล้ว

    when I install an extension and restart the container it doesn't persist so I need to reinstall it again! what's I'm doing wrong?

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      Hmm, I've not experienced this issue. I do know for some extensions you have to go to your extensions list and hit "install in remote". Could be worded differently, but some extensions need to run server-side.

  • @517Amit
    @517Amit ปีที่แล้ว

    Nice video

  • @alan-
    @alan- ปีที่แล้ว +1

    That was a great tutorial, very clear and concise, thanks. I've subscribed and am going to commence binge-watching your other videos which all look interesting. React+Vite next...

  • @manee427
    @manee427 ปีที่แล้ว

    How did you opened your terminal in windows with shortcut?

  • @DavidSuárez-y2s
    @DavidSuárez-y2s ปีที่แล้ว +1

    I prefer to create my own Docker Compose with bind mounts to my repo code, and then use the VSCode's "attach to running container" functionality. Way easier, and without boiler plate. In this video they explain how easy it is to attach: th-cam.com/video/8gUtN5j4QnY/w-d-xo.html&ab_channel=Code2020

  • @utkarshkukreti239
    @utkarshkukreti239 ปีที่แล้ว

    Fantastic

  • @clamhammer2463
    @clamhammer2463 ปีที่แล้ว

    I can't use docker because of some setting in my bios. I can't find the setting to save my life.

    • @EngineeringVignettes
      @EngineeringVignettes ปีที่แล้ว

      You need to enable hypervisor support in the BIOS?
      Also have to start the Windows 10/11 hypervisor (google Enable Hyper-V on windows)
      Both WSL and Docker will now use the Windows Hypervisor which makes things a lot easier now. The only possible glitch is if you are also running a VM, it may be incompatible.

  • @Azeemhassan-i2k
    @Azeemhassan-i2k 10 หลายเดือนก่อน

    i search all over the youtube there is no one tell the solution how we will manage "nodemon" with devcontainer, not just nodemon but same next.js, vue.js, laravel vite.

  • @Neo-zy5vg
    @Neo-zy5vg ปีที่แล้ว

    Checklist driven development

  • @davidhughes3834
    @davidhughes3834 7 หลายเดือนก่อน

    Nice :) +1 sub

  • @mannb1023
    @mannb1023 หลายเดือนก่อน

    nice

  • @esra_erimez
    @esra_erimez ปีที่แล้ว +2

    I wish there was a JetBrains version of this

    • @DanCanCode
      @DanCanCode  ปีที่แล้ว

      Agreed. The remote ssh and remote containers are one of reasons I eventually moved on from Pycharm

  • @couffin
    @couffin ปีที่แล้ว

    Subscribe, like and share. This is a really great video!

  • @RajinderYadav
    @RajinderYadav ปีที่แล้ว

    This is stupid to copy files into a devcontainer? with docker you can just mount the volume into the container of the local host system. So basically devcontainer is for people too lazy to learn a few basic docker commands? ewwwe so I have to now put a dockerfile into a vscode type json file? 😂 ...oh ya much easier. Now some clown developer needs to read both dockerfile and devcontainer json file manuals and other configurations info when you get past some simple hello world setup.

  • @xaas
    @xaas 5 หลายเดือนก่อน

    30 minutes should've been 5 without all the water... don't waste my time please