zoukankan      html  css  js  c++  java
  • docker plugin test

     docker build -t docker-volume-drbd .
     id=$(docker create docker-volume-drbd true)
     docker export $id -o img.tar

    解压到rootfs

    scp.sh `pwd`/drbd_plugin /home/ubuntu 

    docker plugin create drbd ./drbd_plugin

    docker plugin enable test

    docker volume create -d test -o sshcmd=mhc@1111:pppp -o password=123 testvolume

    ubuntu@9f8967ee-e741-4638-9c93-d88f37e2ec01:~/plugin_test$ docker volume ls
    DRIVER              VOLUME NAME
    test:latest         testvolume

    Run 'docker volume COMMAND --help' for more information on a command.
    ubuntu@9f8967ee-e741-4638-9c93-d88f37e2ec01:~/plugin_test$ docker volume inspect testvolume
    [
        {
            "Driver": "test:latest",
            "Labels": {},
            "Mountpoint": "/mnt/volumes/ea700c1b8e3d0add8de24006225f52da",
            "Name": "testvolume",
            "Options": {
                "password": "123",
                "sshcmd": "mhc@1111:pppp"
            },
            "Scope": "local"
        }
    ]

     scp drbd-docker-plugin 109.105.7.96:/tmp && ssh 109.105.7.96 scp /tmp/drbd-docker-plugin ubuntu@109.105.30.106:/home/ubuntu

    docker run -d -v test1:/test registry.bst-1.cns.bstjpc.com:5000/debian:jessie bash -c "while true;do echo haha >> /test/a.txt;sleep 5;done"
    docker rm $(docker ps -qa) && docker volume rm test1 && docker plugin disable drbd && docker plugin rm drbd
    docker plugin create drbd ./drbd_plugin && docker plugin enable drbd && cat ./log/test.log && docker volume create -d drbd test1

    docker run -ti --rm --volume-driver=test2 -v haha2:/test registry.bst-1.cns.bstjpc.com:5000/debian:jessie bash

  • 相关阅读:
    C++的Socket的使用源码
    一些程序技术简介
    VMware安装步骤既常见问题
    操作系统和环境准备
    第一章-硬件组成
    python之面向对象
    指向方法之委托(一)
    Django之URL控制器(路由层)
    python之字符编码(四)
    python之字符编码(三)
  • 原文地址:https://www.cnblogs.com/mhc-fly/p/7779600.html
Copyright © 2011-2022 走看看