-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-install.sh
49 lines (38 loc) · 1.15 KB
/
docker-install.sh
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
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail -x
# Ensure we keep apt cache around in a Docker environment
rm /etc/apt/apt.conf.d/docker-clean
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
declare -ar PERSISTENT_PACKAGES=(
ca-certificates
libgensio-dev
libyaml-dev
tini
)
declare -ar TEMP_PACKAGES=(
automake
build-essential
libtool
make
openipmi
pkg-config
wget
)
# install basic packages required
apt-get update
apt-get install --no-install-recommends --yes "${TEMP_PACKAGES[@]}" "${PERSISTENT_PACKAGES[@]}"
declare -xr archive="/ser2net/cache/ser2net_${VERSION:?}.tar.gz"
declare -xr download_url="https://github.com/cminyard/ser2net/archive/refs/tags/v${VERSION}.tar.gz"
# if file do not exists, or is invalid archive grab it again
if [[ ! -e "${archive}" ]] || ! tar --list -f "${archive}" >/dev/null; then
wget --output-document="${archive}" "${download_url}"
fi
tar zxfv "${archive}" -C /tmp
cd "/tmp/ser2net-${VERSION}"
./reconf
./configure --sysconfdir=/etc
make -j
make -j install
apt-get remove -y "${TEMP_PACKAGES[@]}"
apt-get autoremove -y
rm -rf /tmp/*