DOCKER TUTORIAL – CS50 on Twitch, EP. 23



Join CS50’s David J. Malan for a tour of Docker, a piece of software that utilizes “containers” for making development and deployment of applications all the easier, compared to methods like vhosting of yesteryear and more current methods like virtualization.

Co-hosted by Colton Ogden. Tune in live on twitch.tv/cs50tv and become a part of the live chat.

This is CS50 on Twitch.

source

25 comments

  • Mella_ Meezie 5 months ago

    📝

  • Abdul Mateen 5 months ago

    Watching this after completing my Graveyard Shift! Believe you me learning from David is better than sleeping after that long hours of work!

  • Muhammad Mubashirullah Durrani 5 months ago

    I used Git Bash to run this because I don't know window commands.
    First error: winpty needs to be added to the command.
    Second error: Go to settings -> resources -> file sharing and check C drive

  • Ertan Kara 5 months ago

    I love how you can simplify things.

  • Ashish Kamble 5 months ago

    Amazing Thanks

  • Eve Kim 5 months ago

    Just got Cc from Wiseseller on telegram

  • Marcel Strzałka 5 months ago

    Hey, thanks for the video. I was able to spot some mistakes in english subtitles. Is there any way to propose changes to them?

  • Omnia Gamal 5 months ago

    i want the answer of this question please
    (Create A small (Static or dynamic) Web Application that get booted using docker. The Code of Both the App and the Docker File will be delivered using your GitHub Page)

  • Shubham 5 months ago

    what make David unique from others is his energy,every time I see him teaching somethings I also resonate with his energy to learn

  • Александр Морженко - поэт каменного века 5 months ago

    Хлопцi чому вi не спилкуiтесь мовою ?

  • Cesar Paredes Jr. 5 months ago

    awesome class…………………………….:) ……………………..bye

  • R. Gurung 5 months ago

    What is difference between a docker image and a digitalocean image ?

  • Kolya Slisarenko 5 months ago

    Hello, could someone clarify, what is the difference between Docker image and Docker container?

  • Igor Voltaic 5 months ago

    With all my respect to Professor, this video mixes containers with images which is not right, cause it actually confused me and surely will confuse any docker newbie like myself.

    $ docker build .
    this command builds an IMAGE and NOT a container!

    $ docker run -it [image name] (e.g. docker run -it cs50/cli)
    this command runs NEW container using (or better to say «on top of») your image (btw -it means «take me to the shell of this new container»)

    Do containers persist? Here’s the answer in Docker’s FAQ —> https://docs.docker.com/engine/faq/
    Q: Do I lose my data when the container exits?
    A: Not at all! Any data that your application writes to disk gets preserved in its container until you explicitly delete the container. The file system for the container persists even after the container halts.
    This means you do not need to reinstall anything and all your data is safe in the container.

    Indeed if you need to flush everything, you can delete your old container and do «Docker run» again.

    See all of your containers (stopped and running) like this:
    $ docker ps –all
    you will see container names in the first column

    if you want to start your stopped container and access it’s shell right away run this:
    $ docker start -ia [container name] (e.g. docker start -ia 7dbd85cec821)

    or if container is running you may just attach to it
    $ docker attach [container name] (e.g. docker attach 7dbd85cec821)

    btw you can rename container (not image) like this
    $ docker rename [container name] cs50 (e.g. docker rename 7dbd85cec821 cs50)

    UPDATE: After getting this part I still had several questions:
    – Why is it called «Docker» after all?
    – How much space does a container take? (e.g. What if i run 1000 containers?)
    – Anyways.. I still don’t get it, what’s the difference between VMs and docker? Is it just faster?

    All of the above goes together.
    Docker is a piece of software first of all and what it does is docks your containers onto your images (just like on cargo ships ships). No, containers does not take much space on your hard drive. When you create a container Docker just writes down the difference between an image and container created on top of this image. So when you don’t do any changes to the container the difference is zero, the container is empty. if it’s 1000 empty containers its just 1000 diff files and that’s not a lot of space. To run those docker shares one image between them and simultaneously reads its data and uses resources.

    «So, let's say you have a 1 GB container image; if you wanted to use a full VM, you would need to have 1 GB times x number of VMs you want. With Docker and AuFS you can share the bulk of the 1 GB between all the containers and if you have 1000 containers you still might only have a little over 1 GB of space for the containers OS (assuming they are all running the same OS image).» read this for more info —> https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine

    Docker is just a fancy way to run a process, not a virtual machine.

    BUT:
    While Linux can create containers natively, both Docker for Mac and Windows use Linux VMs to run the containers. Docker for Mac OS X uses hypervisor (xhyve) which is native to mac, to run Linux (a lightweight distro just to run docker) on top of it. The Linux VM that Docker runs in Mac is read-only. However, you can bash into it by running:
    screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

    Thanks for the video anyways, cause it helped me to figure all this out 🙂

  • Abhishek Kumar 5 months ago

    Thank u for this awesome video

  • Shaz Kingdom 5 months ago

    Thank you for this!

  • LittlecErased 5 months ago

    Gave me some great insights in working with Docker. Thanks a lot! Love the CS50 Twitch 'lectures'

  • Ian Prado 5 months ago

    Can you do a video on IPFS?

  • Ian Prado 5 months ago

    <3

  • Ra Far 5 months ago

    The kid is so cute

  • Joshua Aguilar 5 months ago

    Joshua Aguilar
    1 second ago

    How to save and quit the vi or vim text editor 🙂
    To save and quit the vi or vim editor with saving any changes you have made:
    (press I to start inserting code)
    If you are currently in insert or append mode, press Esc key.
    Press : (colon). The cursor should reappear at the lower left corner of the screen beside a colon prompt.
    Enter the following command (type 😡 and press Enter key):

    I do not think you should apologize for looking up syntax, it was my favorite part. It shows the life of real developers. It teaches how to look things up and helps people understand that everybody does not always know the perfect syntax all the time. Great share as always

  • Roland Gerard 5 months ago

    Very good demo, thanks guys 👍

  • PJ Brunet 5 months ago

    The whole premise is based on a falsehood. The cost of virtualizing an entire OS is extremely low (pennies/day) so you're adding complexity to save a few dollars, which is really stupid. (And the cost is dropping every day.) Running a business, you don't want to add new software unless there's a significant benefit. Most businesses will not save more than a few dollars by using Docker. So Docker is a waste of time unless you have 1000s of VMs, which is extremely rare IRL.

  • Emrul Zawad 5 months ago

    damn docker

  • Solomon UDOH 5 months ago

    Good to be here

Comments are closed.