Skip to content

Commit cd6ebc6

Browse files
committed
Proper readme along with a license
1 parent 9684b47 commit cd6ebc6

16 files changed

+708
-64
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
3+
## Unreleased
4+
5+
### Added
6+
7+
- Initial implementation

CONTRIBUTORS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Authors
2+
3+
**docker-volume-loopback** is written and maintained by [Borys Pierov](https://github.com/ashald).
4+
5+
# Contributors
6+
* Be the 1st one!

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Borys Pierov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,44 @@ ROOTFS_CONTAINER := ${PLUGIN_NAME}-rootfs
66
ROOTFS_IMAGE := ${AUTHOR}/${ROOTFS_CONTAINER}
77

88

9+
.PHONY: all
910
all: format build
1011

1112

13+
.PHONY: format
1214
format:
1315
go fmt ./...
1416

1517

18+
.PHONY: build
1619
build:
17-
GOOS=linux GOARCH=amd64 go build -o "$(PLUGIN_NAME)"
20+
GOOS=linux GOARCH=amd64 go build -o $(PLUGIN_NAME)
1821

1922

23+
.PHONY: test
24+
test:
25+
./tests/run.sh
26+
27+
28+
.PHONY: clean
2029
clean:
21-
mkdir -p ./plugin/rootfs
22-
rm -rf ./plugin/rootfs
23-
rm -f ./$(ROOTFS_IMAGE)
30+
mkdir -p ./plugin/rootfs
31+
rm -rf ./plugin/rootfs
32+
rm -f ./$(ROOTFS_IMAGE)
33+
2434

35+
.PHONY: clean-plugin
2536
clean-plugin:
26-
docker plugin rm --force $(PLUGIN_FULL_NAME):$(VERSION) || true
27-
docker plugin rm --force $(PLUGIN_FULL_NAME) || true
37+
docker plugin rm --force $(PLUGIN_FULL_NAME):$(VERSION) || true
38+
docker plugin rm --force $(PLUGIN_FULL_NAME) || true
2839

2940

41+
.PHONY: rootfs-image
3042
rootfs-image:
3143
docker build -t $(ROOTFS_IMAGE) .
3244

3345

46+
.PHONY: rootfs
3447
rootfs: rootfs-image
3548
docker rm -vf $(ROOTFS_CONTAINER) || true
3649
docker create --name $(ROOTFS_CONTAINER) $(ROOTFS_IMAGE) || true
@@ -40,26 +53,27 @@ rootfs: rootfs-image
4053
docker rm -vf $(ROOTFS_CONTAINER)
4154

4255

56+
.PHONY: plugin
4357
plugin: rootfs
4458
docker plugin disable $(PLUGIN_NAME) || true
4559
docker plugin rm --force $(PLUGIN_NAME) || true
4660
docker plugin create $(PLUGIN_NAME) ./plugin
4761
docker plugin enable $(PLUGIN_NAME)
4862

4963

64+
.PHONY: plugin-push-version
5065
plugin-push-version: rootfs
5166
docker plugin rm --force $(PLUGIN_FULL_NAME):$(VERSION) || true
5267
docker plugin create $(PLUGIN_FULL_NAME):$(VERSION) ./plugin
5368
docker plugin push $(PLUGIN_FULL_NAME):$(VERSION)
5469

5570

71+
.PHONY: plugin-push-default
5672
plugin-push-default: rootfs
5773
docker plugin rm --force $(PLUGIN_FULL_NAME) || true
5874
docker plugin create $(PLUGIN_FULL_NAME) ./plugin
5975
docker plugin push $(PLUGIN_FULL_NAME)
6076

6177

78+
.PHONY: plugin-push
6279
plugin-push: plugin-push-version plugin-push-default
63-
64-
65-
.PHONY: clean clean-plugin build rootfs-image rootfs plugin plugin-push plugin-push-version plugin-push-default

README.md

Lines changed: 302 additions & 30 deletions
Large diffs are not rendered by default.

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Vagrant.configure(2) do |config|
22
config.vm.box = "ubuntu/bionic64"
33
config.vm.provision :docker
4-
config.vm.provision "shell", inline: "apt-get update && apt-get install -y binutils jq xfsprogs"
4+
config.vm.provision "shell", inline: "apt-get update && apt-get install -y jq xfsprogs"
55
end

docs/demo.cast.jsonl

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
{"version": 2, "width": 80, "height": 28, "timestamp": 1550020224, "env": {"SHELL": "/usr/bin/zsh", "TERM": "screen"}}
2+
[0.000000, "o", "\r\u001b[0m\u001b[23m\u001b[24m\u001b[J\u001b[01;31mloop \u001b[01;34m~ #\u001b[00m \u001b[K\u001b[?1h\u001b=\u001b[?2004h"]
3+
[0.500000, "o", "d"]
4+
[0.600000, "o", "o"]
5+
[0.700000, "o", "c"]
6+
[0.800000, "o", "k"]
7+
[0.900000, "o", "e"]
8+
[1.000000, "o", "r"]
9+
[1.100000, "o", " "]
10+
[1.200000, "o", "v"]
11+
[1.300000, "o", "o"]
12+
[1.400000, "o", "l"]
13+
[1.500000, "o", "u"]
14+
[1.600000, "o", "m"]
15+
[1.700000, "o", "e"]
16+
[1.800000, "o", " "]
17+
[1.900000, "o", "c"]
18+
[2.000000, "o", "r"]
19+
[2.100000, "o", "e"]
20+
[2.200000, "o", "a"]
21+
[2.300000, "o", "t"]
22+
[2.400000, "o", "e"]
23+
[2.500000, "o", " "]
24+
[2.600000, "o", "-"]
25+
[2.700000, "o", "d"]
26+
[2.800000, "o", " "]
27+
[2.900000, "o", "d"]
28+
[3.000000, "o", "o"]
29+
[3.100000, "o", "c"]
30+
[3.200000, "o", "k"]
31+
[3.300000, "o", "e"]
32+
[3.400000, "o", "r"]
33+
[3.500000, "o", "-"]
34+
[3.600000, "o", "v"]
35+
[3.700000, "o", "o"]
36+
[3.800000, "o", "l"]
37+
[3.900000, "o", "u"]
38+
[4.000000, "o", "m"]
39+
[4.100000, "o", "e"]
40+
[4.200000, "o", "-"]
41+
[4.300000, "o", "l"]
42+
[4.400000, "o", "o"]
43+
[4.500000, "o", "o"]
44+
[4.600000, "o", "p"]
45+
[4.700000, "o", "b"]
46+
[4.800000, "o", "a"]
47+
[4.900000, "o", "c"]
48+
[5.000000, "o", "k"]
49+
[5.100000, "o", " "]
50+
[5.200000, "o", "-"]
51+
[5.300000, "o", "o"]
52+
[5.400000, "o", " "]
53+
[5.500000, "o", "s"]
54+
[5.600000, "o", "i"]
55+
[5.700000, "o", "z"]
56+
[5.800000, "o", "e"]
57+
[5.900000, "o", "="]
58+
[6.000000, "o", "1"]
59+
[6.100000, "o", "0"]
60+
[6.200000, "o", "0"]
61+
[6.300000, "o", "M"]
62+
[6.400000, "o", "i"]
63+
[6.500000, "o", "B"]
64+
[6.600000, "o", " "]
65+
[6.700000, "o", "f"]
66+
[6.800000, "o", "o"]
67+
[6.900000, "o", "o"]
68+
[7.000000, "o", "b"]
69+
[7.100000, "o", "a"]
70+
[7.200000, "o", "r"]
71+
[7.300000, "o", "\r\n"]
72+
[7.400000, "o", "foobar\r\n\r\n"]
73+
[7.500000, "o", "\r\u001b[0m\u001b[23m\u001b[24m\u001b[J\u001b[01;31mloop \u001b[01;34m~ #\u001b[00m \u001b[K\u001b[?1h\u001b=\u001b[?2004h"]
74+
[8.500000, "o", "d"]
75+
[8.600000, "o", "o"]
76+
[8.700000, "o", "c"]
77+
[8.800000, "o", "k"]
78+
[8.900000, "o", "e"]
79+
[9.000000, "o", "r"]
80+
[9.100000, "o", " "]
81+
[9.200000, "o", "v"]
82+
[9.300000, "o", "o"]
83+
[9.400000, "o", "l"]
84+
[9.500000, "o", "u"]
85+
[9.600000, "o", "m"]
86+
[9.700000, "o", "e"]
87+
[9.800000, "o", " "]
88+
[9.900000, "o", "i"]
89+
[10.000000, "o", "n"]
90+
[10.100000, "o", "s"]
91+
[10.200000, "o", "p"]
92+
[10.300000, "o", "e"]
93+
[10.400000, "o", "c"]
94+
[10.500000, "o", "t"]
95+
[10.600000, "o", " "]
96+
[10.700000, "o", "f"]
97+
[10.800000, "o", "o"]
98+
[10.900000, "o", "o"]
99+
[11.000000, "o", "b"]
100+
[11.100000, "o", "a"]
101+
[11.200000, "o", "r"]
102+
[11.400000, "o", "\r\n"]
103+
[11.500000, "o", "[\r\n {\r\n \"CreatedAt\": \"2019-02-13T01:10:37Z\",\r\n \"Driver\": \"docker-volume-loopback\",\r\n \"Labels\": {},\r\n \"Mountpoint\": \"/mnt/foobar\",\r\n \"Name\": \"foobar\",\r\n \"Options\": {\r\n \"size\": \"100MB\"\r\n },\r\n \"Scope\": \"local\",\r\n \"Status\": {\r\n \"fs\": \"xfs\",\r\n \"size-allocated\": \"100106240\",\r\n \"size-max\": \"100000000\"\r\n }\r\n }\r\n]\r\n\r\n"]
104+
[11.600000, "o", "\r\u001b[0m\u001b[23m\u001b[24m\u001b[J\u001b[01;31mloop \u001b[01;34m~ #\u001b[00m \u001b[K\u001b[?1h\u001b=\u001b[?2004h"]
105+
[12.600000, "o", "d"]
106+
[12.700000, "o", "o"]
107+
[12.800000, "o", "c"]
108+
[12.900000, "o", "k"]
109+
[13.000000, "o", "e"]
110+
[13.100000, "o", "r"]
111+
[13.200000, "o", " "]
112+
[13.300000, "o", "r"]
113+
[13.400000, "o", "u"]
114+
[13.500000, "o", "n"]
115+
[13.600000, "o", " "]
116+
[13.700000, "o", "-"]
117+
[13.800000, "o", "-"]
118+
[13.900000, "o", "r"]
119+
[14.000000, "o", "m"]
120+
[14.100000, "o", " "]
121+
[14.200000, "o", "-"]
122+
[14.300000, "o", "i"]
123+
[14.400000, "o", "t"]
124+
[14.500000, "o", " "]
125+
[14.600000, "o", "-"]
126+
[14.700000, "o", "v"]
127+
[14.800000, "o", " "]
128+
[14.900000, "o", "f"]
129+
[15.000000, "o", "o"]
130+
[15.100000, "o", "o"]
131+
[15.200000, "o", "b"]
132+
[15.300000, "o", "a"]
133+
[15.400000, "o", "r"]
134+
[15.500000, "o", ":"]
135+
[15.600000, "o", "/"]
136+
[15.700000, "o", "v"]
137+
[15.800000, "o", "o"]
138+
[15.900000, "o", "l"]
139+
[16.000000, "o", " "]
140+
[16.100000, "o", "a"]
141+
[16.200000, "o", "l"]
142+
[16.300000, "o", "p"]
143+
[16.400000, "o", "i"]
144+
[16.500000, "o", "n"]
145+
[16.600000, "o", "e"]
146+
[16.700000, "o", " "]
147+
[16.800000, "o", "d"]
148+
[16.900000, "o", "f"]
149+
[17.000000, "o", " "]
150+
[17.100000, "o", "-"]
151+
[17.200000, "o", "h"]
152+
[17.300000, "o", " "]
153+
[17.400000, "o", "/"]
154+
[17.500000, "o", "v"]
155+
[17.600000, "o", "o"]
156+
[17.700000, "o", "l"]
157+
[18.000000, "o", "\r\n"]
158+
[18.100000, "o", "Filesystem Size Used Available Use% Mounted on\r\n/dev/loop0 96.7M 5.3M 91.3M 6% /vol\r\n\r\n"]
159+
[18.200000, "o", "\r\u001b[0m\u001b[23m\u001b[24m\u001b[J\u001b[01;31mloop \u001b[01;34m~ #\u001b[00m \u001b[K\u001b[?1h\u001b=\u001b[?2004h"]
160+
[30.000000, "o", "\r"]

docs/demo.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/example.0_error.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2019/02/12 22:41:01 Entering go-plugins-helpers getPath
2+
time="2019-02-12T22:41:01Z" level=error msg="failed with an error" ::trace=01D3HXXR2JXRN98VK1WYM218P5.1.2 :func=manager/getVolume :return/err="volume 'foobar' does not exist"
3+
time="2019-02-12T22:41:01Z" level=error msg="failed with an error" ::trace=01D3HXXR2JXRN98VK1WYM218P5.1 :func=manager/Get :return/err="volume 'foobar' does not exist"
4+
time="2019-02-12T22:41:01Z" level=error msg="failed with an error" ::trace=01D3HXXR2JXRN98VK1WYM218P5 :func=driver/Get :return/err="volume 'foobar' does not exist"
5+
2019/02/12 22:41:01 Entering go-plugins-helpers createPath
6+
time="2019-02-12T22:41:01Z" level=error msg="failed with an error" ::trace=01D3HXXR2WJVFSYTECATSDDD1Y.1.2 :func=manager/runCommand :return/err="exit status 1"

docs/example.1_warning.log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2019/02/12 22:42:16 Entering go-plugins-helpers getPath
2+
time="2019-02-12T22:42:16Z" level=error msg="failed with an error" ::trace=01D3HY027K90XG3MKPA5VT11TX.1.2 :func=manager/getVolume :return/err="volume 'foobar' does not exist"
3+
time="2019-02-12T22:42:16Z" level=error msg="failed with an error" ::trace=01D3HY027K90XG3MKPA5VT11TX.1 :func=manager/Get :return/err="volume 'foobar' does not exist"
4+
time="2019-02-12T22:42:16Z" level=error msg="failed with an error" ::trace=01D3HY027K90XG3MKPA5VT11TX :func=driver/Get :return/err="volume 'foobar' does not exist"
5+
2019/02/12 22:42:16 Entering go-plugins-helpers createPath
6+
time="2019-02-12T22:42:16Z" level=error msg="failed with an error" ::trace=01D3HY027SMYHDSBQQCCRC1CM0.1.2 :func=manager/runCommand :return/err="exit status 1"
7+
time="2019-02-12T22:42:16Z" level=warning msg="it seems that 'fallocate' is not supported - falling back to 'dd' to create data-file" ::trace=01D3HY027SMYHDSBQQCCRC1CM0.1 :func=manager/Create data-file=/var/lib/docker-volume-loopback/foobar sparse=false

docs/example.2_info.log

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2019/02/12 22:43:25 Entering go-plugins-helpers getPath
2+
time="2019-02-12T22:43:25Z" level=error msg="failed with an error" ::trace=01D3HY24X9Z7J91ARJSBP1CHHX.1.2 :func=manager/getVolume :return/err="volume 'foobar' does not exist"
3+
time="2019-02-12T22:43:25Z" level=error msg="failed with an error" ::trace=01D3HY24X9Z7J91ARJSBP1CHHX.1 :func=manager/Get :return/err="volume 'foobar' does not exist"
4+
time="2019-02-12T22:43:25Z" level=error msg="failed with an error" ::trace=01D3HY24X9Z7J91ARJSBP1CHHX :func=driver/Get :return/err="volume 'foobar' does not exist"
5+
2019/02/12 22:43:25 Entering go-plugins-helpers createPath
6+
time="2019-02-12T22:43:25Z" level=error msg="failed with an error" ::trace=01D3HY24XECDEXF9QEFXAS61E4.1.2 :func=manager/runCommand :return/err="exit status 1"
7+
time="2019-02-12T22:43:25Z" level=warning msg="it seems that 'fallocate' is not supported - falling back to 'dd' to create data-file" ::trace=01D3HY24XECDEXF9QEFXAS61E4.1 :func=manager/Create data-file=/var/lib/docker-volume-loopback/foobar sparse=false
8+
time="2019-02-12T22:43:26Z" level=info msg="created volume" ::trace=01D3HY24XECDEXF9QEFXAS61E4 :func=driver/Create volume=foobar

0 commit comments

Comments
 (0)