forked from trajano/docker-volume-plugins
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (28 loc) · 800 Bytes
/
build.sh
File metadata and controls
executable file
·30 lines (28 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -e
error() {
printf '\E[31m'; echo "$@"; printf '\E[0m'
}
if [[ $EUID -ne 0 ]]; then
error "This script should be run using sudo or as the root user"
exit 1
fi
TAG=$1
build() {
docker plugin rm -f ximoneighteen/$1 || true
docker rmi -f rootfsimage || true
docker build -t rootfsimage $1
id=$(docker create rootfsimage true) # id was cd851ce43a403 when the image was created
rm -rf build/rootfs
mkdir -p build/rootfs
docker export "$id" | tar -x -C build/rootfs
docker rm -vf "$id"
cp $1/config.json build
if [ -z "$TAG" ]
then
docker plugin create ximoneighteen/$1 build
else
docker plugin create ximoneighteen/$1:$TAG build
docker plugin push ximoneighteen/$1:$TAG
fi
}
build glusterfs-volume-plugin