Skip to content

Latest commit

 

History

History
 
 

build-io

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

File I/O example

This directory demonstrates several Docker topics:

  • The usefulness of volume mechanism in Docker.
  • The docker logs command.

Steps

  1. Run without Docker

    $ ./io.sh
    $ ./io.sh
    $ ./io.sh
    
    $ cat /tmp/output
  2. Run with Docker, without volume mechanism

    $ docker build -t io .
    
    $ docker run io
    $ docker run io
    $ docker run io
    
    $ cat /tmp/output
    
    $ docker ps -a
    $ docker logs <container id>
  3. Run with Docker, with volume mechanism

    $ docker run  -v $(pwd):/tmp  io
    $ docker run  -v $(pwd):/tmp  io
    $ docker run  -v $(pwd):/tmp  io
    
    $ cat ./output
    
    $ docker ps -a
    $ docker logs <container id>