Docker

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.

  1. Getting Started
  2. Explore the application
  3. Getting Started with Docker

Getting Started

  1. see Install docker desktop for windows

    💡 notice:
    requires windows 10 pro or enterprise 64-bit.
    for previous versions get Docker Toolbox.

  2. Download from Docker Hub
  3. Start docker desktop for windows
  4. Test your installation
    • open a terminal window (command prompt)
    • run docker --version to ensure that you have a support version of docker
       > docker --version
      
    • pull the hello-world image from docker hub and run a container
       > docker run hello-world
      
    • list the hello-world image that was downloaded from docker hub
       > docker image ls
      
    • list the hello-world container(thar exited after displaying “hello from docker!”)
       > docker container ls --all
      

Explore the application

  1. ubuntu os
    • pull an image of the ubuntu OS and run an interactive terminal inside the spawned container
       > docker run --interactive --tty ubuntu bash 
       or
       > docker run -it ubuntu bash
      
    • you are in the container. At the root # prompt, check the hostname of the container
       root@:/ # hostname
       root@:/ # exit
       >
      
    • list containers with the –all option
       > docker container ls --all
      
  2. nginx webserver
    • pull and run a Dockerized nginx web server that we name, webserver:
       > docker run --detach --publish 80:80 --name webserver nginx
      
    • point your web browser at http://localhost to display the nginx start page
    • List only your running containers:
       > docker container ls
      
    • stop the running nginx container by the name we assigned it, webserver
       >  docker container stop webserver
      
    • remove all three containers by their names:
       > docker container rm webserver
      

Getting Started with Docker

  1. Part 1: Orientation and setup
    • docker concepts
      • images and containers: a container is launched by running an image
        image is an executable package that includes everything needed to run an application
        container is a runtime instance of an image
      • Containers and virtual machines
        container runs natively on linux and shares the kernel of the host machine with other containers.
        virtual machine runs a full-blown ‘guest’ operating system with virtual access to host resources through a hypervisor.

    containervm

    • prepare your Docker environment
  2. Containers
  3. Services
  4. Sawrms
  5. Stacks
  6. Deploy your app

© 2018. All rights reserved.

Powered by Hydejack v8.4.0