Wednesday, 23 October 2019

Docker 101 - Part3 - Persisting data using volumes

In this article, I will explain how to use Docker volumes for persisting data generated by and used by containers with --mount flag. Volumes use the Docker area and it can be found under /var/lib/docker/volumes/ directory of the Docker host.

Example:

docker run -dit --name centos_volume_test --mount source=data_volume01,target=/datavol01 centos sleep 1800

The above command will run a CentOS container and mounts a volume at /datavol01 inside the container. It uses source /var/lib/docker/volumes/data_volume01. The below screenshot shows the necessary steps to verify it.



Hope it was useful. Cheers!

Related posts


Docker 101 - Part2 - Basic operations

Docker 101 - Part1 - Installation


References




2 comments:

  1. Okay...

    This may sound pretty weird, and maybe even kind of "supernatural"

    WHAT if you could just push "PLAY" to listen to a short, "miracle tone"...

    And magically attract MORE MONEY to your life??

    I'm talking about hundreds... even thousands of dollars!!!

    Sounds way too EASY?? Think this couldn't possibly be for REAL??

    Well then, Let me tell you the news.

    Many times the largest blessings in life are also the SIMPLEST!!!

    In fact, I'm going to PROVE it to you by allowing you to PLAY a real-life "magical money-magnet tone" I've synthesized...

    And do it FREE (no strings attached).

    You just push "PLAY" and you will start having more money come into your life... starting pretty much right away...

    CLICK here now to play this mysterious "Miracle Wealth Building Tone" - it's my gift to you!!!

    ReplyDelete
  2. This blog presented itself in a very easy and clear way. Owner of this blog found a very simple way to express its view but when you read this blog completely, you would get to know about how hard it could be to express such in a easy way.
    C2
    C4ISR

    ReplyDelete