Code Monkey home page Code Monkey logo

docker-guide-for-beginners's Introduction

Open Presentation Materials

Slides

Install Docker and Docker compose on your machine

Docker Commands Examples

Docker Playground

  1. run hello world: docker run hello-world
  2. complex image: docker run -it danielkraic/asciiquarium
  3. get images: docker iamges
  4. list containers: docker ps, docker ps -a, docker container ls
  5. container runs and close: docker run ubuntu, docker run ubuntu echo hi
  6. check for it in the images: docker iamges
  7. previously run containers: docker ps -a

  1. keep running: docker run ubuntu sleep 5
  2. run in interactive mode: docker run -it ubuntu

  1. get a new image: docker pull kodekloud/simple-webapp
  2. run the image: docker run kodekloud/simple-webapp
  3. Hide logs(detached mode): docker run -d kodekloud/simple-webapp
  4. check it: docker ps
  5. attach the container to see logs(no logs?): docker attach <ID>
  6. get the logs: docker logs <ID>

  1. detach ubuntu: docker run -d -it ubuntu
  2. exec ubuntu: docker exec b2 echo hi

  1. inspect: docker inspect <ID>
  2. remove the container: docker rm <ID>

  1. map ports: docker run -p 80:8080 kodekloud/simple-webapp
  2. get networks: docker network ls

  1. view build history of an image: docker history kodekloud/simple-webapp

Useful Notes:

  • If you encountered this error

    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json": dial unix /var/run/docker.sock: connect: permission denied

Just type: sudo chmod 666 /var/run/docker.sock

docker-guide-for-beginners's People

Contributors

mostafa-wael avatar

Stargazers

Omar Mekkawy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.