Docker Crash Course #10 - Volumes

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

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

  • @HelloWorld-tn1tl
    @HelloWorld-tn1tl 7 หลายเดือนก่อน +9

    This teaching style is great, it shows every detail you need to know, make you really understand it.

    • @NetNinja
      @NetNinja  7 หลายเดือนก่อน +2

      Thank you :) that means a lot

  • @ikhlasoyelami8383
    @ikhlasoyelami8383 ปีที่แล้ว +47

    It is what it is. I thought docker is one complex course after watching a 5 hours video. It was nice till I ran into Net Ninja, your tutorials are just spectacular

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

      Great to hear Ikhlas!

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

      He’s blessed. He’s the best

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

    Thank you for putting so much effort in your videos to make them as much clear as possible

  • @PrakashBesra
    @PrakashBesra ปีที่แล้ว +10

    The second -v flag (-v /app/node_modules) mounts a volume (Docker internal volume) at the /app/node_modules directory inside the container. This is done to avoid overwriting the node_modules directory with the local version. Mounting a volume here means that the local node_modules directory will not be used, and the image's built-in node_modules will be preserved.

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

      So this has been bordering me for a while. What do you do when you want to install packages or uninstall packages as you develop you application. If the node_modules on you host is not in sync with the one in the container?

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

      @@isidorenwaiwu2793 create a new image i suppose

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

    I was searching for docker volumes today. Thanks Shaun!

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

    When running a command to use volumes I'm getting an error docker: Error response from daemon: mkdir C:UserssamokDesktopdocker-ninjaapi: Access is denied.
    UPD: This is because the \ character has a special meaning in Git Bash. If you are using Git Bash, you must neutralize it using \\:

    • @akhrorbekabdukhamitov8872
      @akhrorbekabdukhamitov8872 2 ปีที่แล้ว

      this comment is underrated!

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

      for anyone getting the same error, if you're using gitbash as default vscode terminal then just use /$(pwd) instead of copy the path as shown in the video.

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

      @@alcymn Thank you very much for this. I was about to give up on it

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

      ​@@alcymn Thank you so much!
      I just opened a normal powershell terminal in VS code and it worked flawlessly! 😇
      And I was also almost about to give up 🤪
      It actually didn't work for me in the bash terminal in vs code, (on windows) got the following error: "docker: Error response from daemon: mkdir C:\Program Files\Git\;C: Access is denied." (gave permission to all users in windows, still didn't work)

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

      Third tutorial I watch and I simply couldn't solve the fact the container was simply not mapping to the host, just because of a freaking /... Thanks Alexander for your comment, you saved me a lot of stress, more than I already accumulated haha

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

    amazing!!! i heart docker now .. thanks for explaining very easily and well!!! kudos

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

      Glad it helped! thanks Kuri :)

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

    Please include docker in your future full stack videos. Thank you

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

    Everything works, Hallelujah 😂😂 Never heard that one before.

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

    Thank you. Very clear and interesting even if this last video gave me a bit headache :D

  • @xiaotingshao3689
    @xiaotingshao3689 ปีที่แล้ว +8

    I got error when I use -v, showed syntax error. I put the path after -v in double quotes, then fix the error. Hopefully can help some of you. And we can delete node_modules from our app as well. Docker use the modules inside image

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

      thanks. it works like charm ^^

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

      dude you just solved problem that I been stuck for hours on thanks 🤗

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

    Hi Shaun... can you please do a full dockerfide web application wih mySQL build and maybe a host file server volume config files? :) love your channel

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

    Brilliant playlist.

  • @davidk7212
    @davidk7212 7 หลายเดือนก่อน +2

    Are there any pros/cons of implementing the "nodemon app.js" command as a script in the package.json file versus specifying it directly in the CMD instruction of the Dockerfile, or is it more a matter of style or preference?

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

    Hi Ninja, it was awesome tutorial, small request , can you please do tutorial on deploying it to aws?

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

    I run into an error : "Unable to find image :locally' because there were whitespace in my absolute path after -v tag. So to remove this error, make sure there is no space in folder name in your absolute path. It will fix the problem. hope it helps and the tutorial is awesome!!!

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

      Thank you!

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

      Thanks brother! Helped me

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

    Does dockerignore file is ignore when we are using volumes? For example if we have placed a folder in dockerignore file but it has been mapped using volumes. Does the folder will be mapped or since it is in dockerignore it will be ignore because it was not copied to the during the image build?

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

    If everything is mirrored to the container using volumes so does it meant that dockerignore which avoids some folders to be copied to the image so that folders are now also the inside the container?

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

    With volume and all our local files mapped with container /app directory, is "COPY . ." layer still necessary ? Thanks in advance

  • @hemangshrimali6308
    @hemangshrimali6308 2 ปีที่แล้ว

    Really nice way of explaining by example.

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

    I tried removing the "node_modules" folder in the directory, and not creating a volume for it. But, when the container is created and started, the app crashes... showing the error "Error: Cannot find module 'express''"...
    Is it still necessary use "-v /app/node_modules" even when we do not have the node_modules folder in our host directory? Why?

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

      I had the same problem,. I dont understand why I need to have the second volume when it doesnt exist on the host

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

    I am confused, this just seems to be uploading what is inside the api folder locally to the container folder, what does this have to do with peristent storage?

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

    Got error !! error Couldn't find a package.json file in "/app"

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

    The part when he said everything is working fine hallielulliwya was comedy

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

    when you write the sevond volume "-v /app/node_modules" and explained that this creates some folder in our host and maps to it for next runs(16:25). BUT you also use "--rm" which deletes the container after stop, so how can it run the second time as well if after stop its deleted? and what happened with the folder in our host after stop?

  • @m.e10150
    @m.e10150 2 ปีที่แล้ว

    Thank you very much

  • @ArunKumar-wh1pe
    @ArunKumar-wh1pe ปีที่แล้ว

    When running a command to use volumes I'm getting an error docker: Error response from daemon: invalid mode: /app.

  • @deybmen
    @deybmen 2 ปีที่แล้ว

    What's the difference of using Docker vs. using an all around version manager like asdf, for development?

  • @stullesblog6692
    @stullesblog6692 2 ปีที่แล้ว

    I have one problem with the -v using the absolute path. that does not work on my mac. for some reason, it puts a "/host_mnt" in front of my absolute path. Do you have an idea?

  • @phemiewilliams
    @phemiewilliams 2 ปีที่แล้ว

    Everything runs Halleluyah! lol! Nice tutorial

    • @NetNinja
      @NetNinja  2 ปีที่แล้ว

      Awesome :) thanks for watching!

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

    For anyone dealing with the error message: "Error response from daemon: error while creating mount source path ... mkdir file exists", just restart docker desktop and it should go away : )

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

    Please do a course on traefik

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

    what if I add new node_modules, would the code break?

  • @muhammadtarique242
    @muhammadtarique242 2 ปีที่แล้ว

    Nodemon has an issue, when a crash will happen then nodemon will still continue and not stop. This is why i believe nodemon shouldn't be used here in docker

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

    CMD looks funny, array of three strings xd

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

    👍👍

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

    10:41 😂

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

    compose ile halledeceksek niye anlattin oe

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

    Waw

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

    Your content, in this video, is pretty confusing; pretty painfull.
    My opinion about this serie is that it's lower quality than usual.

    • @Kevin-ou1zg
      @Kevin-ou1zg ปีที่แล้ว

      have you seen a better docker course somewhere? I've checked the laracasts one, this one is better

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

      this is a good docker course

  • @anasouardini
    @anasouardini 9 หลายเดือนก่อน +1

    This video is 4 minutes about volumes and 12 minutes about everything else from nodemon to images and containers LOL. Thanks for wasting my time.

  • @anasouardini
    @anasouardini 9 หลายเดือนก่อน +1

    Bro, you keep repeating yourself a thousand times throughout the video.

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

    hopefully you still watch these comments. First of all thanks a mil! for doing these vids!
    I ran into an issue with COPY:
    WORKDIR /var/www
    COPY index.html .
    COPY hello.html .
    => => transferring context: 29B 0.0s
    => CACHED [2/6] RUN apt-get -y update && apt-get -y install nginx 0.0s
    => CACHED [3/6] COPY default /etc/nginx/sites-available/default 0.0s
    => CACHED [4/6] WORKDIR /var/www 0.0s
    => CACHED [5/6] COPY index.html . 0.0s
    => ERROR [6/6] COPY hello.html .
    If I do a COPY . . I get the Dockerfile and default file copied over to the /var/www but NOT the html files. What am I doing wrong?
    If I use COPY *.html . it builds OK but when I then ls the /var/www I get
    # ls /var/www
    Dockerfile default
    Cheers!