-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBockerfile.base
54 lines (45 loc) · 1.09 KB
/
Bockerfile.base
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Purpose: Bocker base support for Debian-base images
# Author : Anh K. Huynh
# Date : 2015 May 15th
ed_from "ubuntu:14.04"
ed_maintainer "Anh K. Huynh <kyanh@theslinux.org>"
ed_ship ed_apt_clean ed_apt_purge ed_apt_install ed_apt_remove
ed_cmd '["/supervisor.sh"]'
ed_apt_clean() {
rm -fv /var/cache/apt/*.bin
rm -fv /var/cache/apt/archives/*.*
rm -fv /var/lib/apt/lists/*.*
apt-get autoclean
}
ed_apt_purge() {
apt-get purge -y --auto-remove $@
ed_apt_clean
}
ed_apt_install() {
apt-get update
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends $@
}
ed_apt_remove() {
DEBIAN_FRONTEND=noninteractive \
apt-get remove -y $@
}
ed_bocker_min_version() {
echo "${BOCKER_VERSION:-0.0.0}" \
| awk \
-vMIN_VERSION="${1:-0.0.0}" \
-F. \
'
{
version = 100 * $1 + 10 * $2 + $3;
if (version >= MIN_VERSION) {
exit(0);
}
else {
printf("Bocker version >= %d is required. Your version = %d\n", MIN_VERSION, version) > "/dev/stderr";
exit(127);
}
}
'
}