Coder Social home page Coder Social logo

docker's Introduction

Docker

Docker Exercise 1.1

GETTING STARTED Since we already did "Hello, World!" in the material let's do something else. Start 3 containers from an image that does not automatically exit (such as nginx) in detached mode. Stop two of the containers and leave one container running. Submit the output for docker ps -a which shows 2 stopped containers and one running.

iemafzal~docker ps -a
CONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS          PORTS      NAMES
f424fb367366   redis     "docker-entrypoint.s…"   9 seconds ago    Up 9 seconds    6379/tcp   zealous_visvesvaraya
a5d9d31e1fd3   httpd     "httpd-foreground"       18 seconds ago   Up 17 seconds   80/tcp     dazzling_banzai
57b67b8f1b13   nginx     "/docker-entrypoint.…"   32 seconds ago   Up 32 seconds   80/tcp     intelligent_wilson
iemafzal~docker stop f424fb367366 a5d9d31e1fd3
f424fb367366
a5d9d31e1fd3
iemafzal~docker ps -a
CONTAINER ID   IMAGE     COMMAND                  CREATED              STATUS                     PORTS     NAMES
f424fb367366   redis     "docker-entrypoint.s…"   52 seconds ago       Exited (0) 5 seconds ago             zealous_visvesvaraya
a5d9d31e1fd3   httpd     "httpd-foreground"       About a minute ago   Exited (0) 4 seconds ago             dazzling_banzai
57b67b8f1b13   nginx     "/docker-entrypoint.…"   About a minute ago   Up About a minute          80/tcp    intelligent_wilson
iemafzal~
Docker 1 1

Docker Exercise 1.2

CLEANUP

We have containers and an image that are no longer in use and are taking up space. Running docker ps -a and docker image ls will confirm this. Clean the Docker daemon by removing all images and containers. Submit the output for docker ps -a and docker image ls

iemafzal~docker stop f424fb367366 a5d9d31e1fd3
f424fb367366
a5d9d31e1fd3
iemafzal~docker ps -a
CONTAINER ID   IMAGE     COMMAND                  CREATED              STATUS                     PORTS     NAMES
f424fb367366   redis     "docker-entrypoint.s…"   52 seconds ago       Exited (0) 5 seconds ago             zealous_visvesvaraya
a5d9d31e1fd3   httpd     "httpd-foreground"       About a minute ago   Exited (0) 4 seconds ago             dazzling_banzai
57b67b8f1b13   nginx     "/docker-entrypoint.…"   About a minute ago   Up About a minute          80/tcp    intelligent_wilson
iemafzal~docker rm f4 a5 57 
f4
a5
57
iemafzal~docker ps -a
CONTAINER ID   IMAGE     COMMAND                  CREATED              STATUS                      PORTS     NAMES
cf4af5cbbf78   httpd     "httpd-foreground"       58 seconds ago       Exited (0) 43 seconds ago             competent_davinci
1fa66b6b340a   nginx     "/docker-entrypoint.…"   About a minute ago   Exited (0) 44 seconds ago             vigorous_bassi
131e3dc4c7ce   redis     "docker-entrypoint.s…"   About a minute ago   Exited (0) 44 seconds ago             laughing_chatelet
iemafzal~docker rm cf 1f 131
cf
1f
131
iemafzal~docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
iemafzal~docker ps 
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
iemafzal~
Docker 1 2

docker's People

Contributors

iemafzalhassan avatar imgbotapp avatar

Watchers

 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.