• 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

  • 相关阅读:
    VS2010快捷键
    mvc 简单的分页扩展
    Asp.net(C#)给图片加上水印效果
    HTML特殊字符编码大全
    获取URL上的参数值
    json数据的时间格式转换如:/Date(2342561534)/
    js中文编码到C#后台解码
    获取浏览器滚动条高度
    使用js画图
    silverlight实时从Javascript获取json数据
  • 原文地址:https://www.cnblogs.com/mhc-fly/p/7779600.html
Copyright © 2020-2023  润新知