containers / docker-lvm-plugin

Docker volume plugin for LVM volumes
GNU Lesser General Public License v3.0
155 stars 64 forks source link

make not running go dependencies #49

Closed rocki9satya closed 6 years ago

rocki9satya commented 6 years ago

When I run the make command, i get lot of errors, mainly to do with dependencies

a. yum install golang git golang-github-cpuguy83-go-md2man b. mkdir -p $HOME/go/src/github.com c. cd $HOME/go/src/github.com d. export GOPATH=$HOME/go e. git clone https://github.com/projectatomic/docker-lvm-plugin.git f. make

First error it doesnt find github.com/Sirupsen/logrus

[root@apilibgdpr docker-lvm-plugin]# make go-md2man -in man/docker-lvm-plugin.8.md -out docker-lvm-plugin.8 /usr/bin/go build -o docker-lvm-plugin . main.go:8:2: cannot find package "github.com/Sirupsen/logrus" in any of: /usr/lib/golang/src/github.com/Sirupsen/logrus (from $GOROOT) /root/go/src/github.com/Sirupsen/logrus (from $GOPATH) utils.go:14:2: cannot find package "github.com/docker/docker/pkg/system" in any of: /usr/lib/golang/src/github.com/docker/docker/pkg/system (from $GOROOT) /root/go/src/github.com/docker/docker/pkg/system (from $GOPATH) driver.go:10:2: cannot find package "github.com/docker/go-plugins-helpers/volume" in any of: /usr/lib/golang/src/github.com/docker/go-plugins-helpers/volume (from $GOROOT) /root/go/src/github.com/docker/go-plugins-helpers/volume (from $GOPATH) make: *** [lvm-plugin-build] Error 1

Please advise

rocki9satya commented 6 years ago

Also tried with old version https://github.com/shishir-a412ed/docker-lvm-plugin.git I am able to build this version without error, but the luks crypt option is not working, it always creates lvm and doesnt show crypt in lsblk

sudo mount -t ramfs -o size=4M ramfs /var/run/key sudo dd if=/dev/urandom of=/var/run/key/luks-volume-example.bin bs=1024 count=16 docker volume create --driver lvm --name example2 --opt size=100M --opt thinpool=volumes --opt crypt=luks --opt keyfile=/var/run/key/luks-volume-example.bin docker run -d --name example2 -v example2:/mnt/example2 centos:7 tail -f /dev/null

xvdc 202:32 0 250G 0 disk |-docker-internal_tmeta 253:0 0 52M 0 lvm
| -docker-internal 253:2 0 50G 0 lvm | |-docker-202:2-4334526-2474ca75f09a9b2198bbfcffc278532e89d64d85873f62d3c115e9c79b49a785 253:7 0 10G 0 dm /var/lib/docker/devicemapper/mnt/2474ca75f09a9b2198bbfcffc278532e89d64d85873f62d3c115e9c79b49a785 |-docker-202:2-4334526-0f51655181e9a04c5826cae9750a856cf00e285f940eb90c0ef6bda658c1fef3 253:9 0 10G 0 dm /var/lib/docker/devicemapper/mnt/0f51655181e9a04c5826cae9750a856cf00e285f940eb90c0ef6bda658c1fef3 |-docker-internal_tdata 253:1 0 50G 0 lvm
| -docker-internal 253:2 0 50G 0 lvm | |-docker-202:2-4334526-2474ca75f09a9b2198bbfcffc278532e89d64d85873f62d3c115e9c79b49a785 253:7 0 10G 0 dm /var/lib/docker/devicemapper/mnt/2474ca75f09a9b2198bbfcffc278532e89d64d85873f62d3c115e9c79b49a785 |-docker-202:2-4334526-0f51655181e9a04c5826cae9750a856cf00e285f940eb90c0ef6bda658c1fef3 253:9 0 10G 0 dm /var/lib/docker/devicemapper/mnt/0f51655181e9a04c5826cae9750a856cf00e285f940eb90c0ef6bda658c1fef3 |-docker-volumes_tmeta 253:3 0 100M 0 lvm
| -docker-volumes 253:5 0 100G 0 lvm |-docker-volumes_tdata 253:4 0 100G 0 lvm |-docker-volumes 253:5 0 100G 0 lvm
|-docker-bi--postgres_bipgdata 253:6 0 50G 0 lvm /var/lib/docker-lvm-plugin/bi-postgres_bipgdata `-docker-example2 253:8 0 100M 0 lvm /var/lib/docker-lvm-plugin/example2

shishir-a412ed commented 6 years ago

@rocki9satya Few things:

1) Please don't use https://github.com/shishir-a412ed/docker-lvm-plugin.git , This is an old project and has been moved to https://github.com/projectatomic/docker-lvm-plugin. Please use projectatomic/docker-lvm-plugin to build the plugin.

2) You need to do make in docker-lvm-plugin directory. I don't see you do cd docker-lvm-plugin or may be you are doing it. Just making sure you are not missing anything.

You can see the comment here: https://github.com/projectatomic/docker-lvm-plugin/issues/41#issuecomment-379565667 OR README.md

3) For these errors: driver.go:10:2: cannot find package "github.com/docker/go-plugins-helpers/volume" in any of: /usr/lib/golang/src/github.com/docker/go-plugins-helpers/volume (from $GOROOT) /root/go/src/github.com/docker/go-plugins-helpers/volume (from $GOPATH)

The respective packages are missing in your $GOPATH. You need to do go get -u github.com/docker/go-plugins-helpers/volume for all missing packages one by one. Once that is done, trying doing make again.

Shishir

rocki9satya commented 6 years ago

Thank you, it is working perfectly.

I have one more question please. While creating a Docker LVM Volume with encryption is it possible to take the key from Docker Secrets.

E.g docker volume create --driver lvm --name example2 --opt size=100M --opt thinpool=volumes --opt crypt=luks --opt keyfile=/run/secrets/luks-volume-example.bin

I am unable to do so at present

shishir-a412ed commented 6 years ago

@rocki9satya I am not sure if they both are related. Better to create a separate LUKS secret file for docker-lvm-plugin encrypted volumes.