How to Create Docker Volume in Microsoft Windows

Posted on

Introduction

This is another article which if focusing on how to use docker tool. Specifically about how to create a volume. In this context, volume is an important feature. Actually, this feature is important for persisting data in a specific folder exist in a docker container.

How to Create Docker Volume in Microsoft Windows

In this part, the main purpose is just to be able to create a docker volume. The process for creating docker volume in this context will be in a local device running using Microsoft Windows operating system. Below is the steps in sequence for executing the process to create docker volume :

  1. First of all, just execute a command line interface. In this context, since it is a local device running using Microsoft Windows operating, run Command Prompt. Below is the appearance of the Command Prompt :

    Microsoft Windows [Version 10.0.22000.1335]
    (c) Microsoft Corporation. All rights reserved.
    C:\Users\Personal>
  2. Before creating a new volume, check the existing volume by executing the following command :

    C:\Users\Personal>docker volume ls 
    DRIVER VOLUME NAME
    C:\Users\Personal> 
    

    So, the command for listing the available docker volume is ‘docker volume ls’.

  3. As the output of the above command execution for listing docker volume is empty, just follow it with the next step. In this case, it is a step for creating a new docker volume. Just type the following command in the command line interface to create a new docker volume :

    C:\Users\Personal>docker volume create webvolume
    webvolume
    C:\Users\Personal>docker volume ls
    DRIVER VOLUME NAME
    local  webvolume
    C:\Users\Personal>

    As it exist in the above command execution, in order to create a new docker volume, just use the command ‘docker create volume_name’. And as in the appearance of the above output command, there is a new docker volume appear. In that case, the command for creating a new docker volume ends in a success having the result of a new docker volume.

Leave a Reply