commit | author | age
|
659253
|
1 |
#!/bin/bash -x |
JK |
2 |
|
|
3 |
NAME=${NAME:-jacekkow/pyipam} |
|
4 |
VERSIONS=${VERSIONS:-latest} |
|
5 |
|
|
6 |
DIR=$(dirname "$0") |
|
7 |
|
|
8 |
cd "${DIR}" || exit 1 |
|
9 |
sudo rm -Rf rootfs |
|
10 |
docker build -t "${NAME}" . || exit 1 |
|
11 |
id=$(docker create "${NAME}" true) |
|
12 |
sudo mkdir -p rootfs |
|
13 |
docker export "${id}" | sudo tar -x -C rootfs |
|
14 |
docker rm -vf "${id}" |
|
15 |
docker plugin disable "${NAME}" |
|
16 |
docker plugin rm "${NAME}" |
|
17 |
sudo chmod 755 rootfs rootfs/usr/src/app/.local && sudo chmod -R o=g rootfs/usr/src |
|
18 |
for VERSION in ${VERSIONS}; do |
|
19 |
sudo docker plugin create "${NAME}:${VERSION}" . |
|
20 |
done |
|
21 |
sudo du -hs rootfs |
|
22 |
for VERSION in ${VERSIONS}; do |
|
23 |
docker plugin enable "${NAME}:${VERSION}" || exit 1 |
|
24 |
break |
|
25 |
done |