-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·27 lines (22 loc) · 811 Bytes
/
build.sh
File metadata and controls
executable file
·27 lines (22 loc) · 811 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
#!/usr/bin/env bash
set -e
SCRIPT_PATH=$(dirname $(readlink -f $0))
echo "==================================="
echo " Building docker"
echo "==================================="
docker build -t temp_alpine_num_py $SCRIPT_PATH
echo
echo "==================================="
echo " Flattening image"
echo "==================================="
container_id=$(docker run -d temp_alpine_num_py sh -c "while true; do sleep 1; done")
docker export $container_id | gzip -7 - > temp_alpine_num_py.tar.gz
docker kill $container_id
docker rm -f $container_id
docker rmi -f temp_alpine_num_py
gunzip < temp_alpine_num_py.tar.gz | docker import - alpine_num_python
echo
echo "==================================="
echo " Built image"
echo "==================================="
docker images | grep alpine_num_python