-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·109 lines (90 loc) · 2.61 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
#
# Install common dependencies
#
apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
dirmngr \
software-properties-common \
build-essential \
libffi-dev \
tk-dev \
uuid-dev \
libssl-dev \
libbz2-dev
#
# Install NodeJS and NPM and frontend dependencies
#
touch ~/.profile
apt-get install -y nodejs npm
curl -o- https\://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | sh
npm install -g yarn
nvm install v10.15.3
#
# Install Python
#
PYTHON_GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
PYTHON_VERSION=3.7.3
PYTHON_PIP_VERSION=19.1
wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"
wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"
export GNUPGHOME="$(mktemp -d)"
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$PYTHON_GPG_KEY"
gpg --batch --verify python.tar.xz.asc python.tar.xz
{ command -v gpgconf > /dev/null && gpgconf --kill all || :; }
mkdir -p /usr/src/python
tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz
rm -f python.tar.xz
cd /usr/src/python
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
./configure \
--build="$gnuArch" \
--enable-loadable-sqlite-extensions \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--without-ensurepip
make -j "$(nproc)"
make altinstall
ldconfig
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' +
rm -rf /usr/src/python
cd /usr/local/bin
ln -s idle3.7 idle
ln -s pydoc3.7 pydoc
ln -s python3.7 python
ln -s python3.7 python3
ln -s python3.7m-config python-config
python3 --version
cd
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
"pip==$PYTHON_PIP_VERSION"
pip --version
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' +
rm -f get-pip.py
#
# Install Docker CE
#
echo "Installing Docker CE via pip..."
pip install docker docker-compose
#
# Clean up
#
rm -rf /var/lib/apt/lists/*