refactor docker to support arm32/arm64/amd64 all in one build

This commit is contained in:
KemoNine
2019-01-11 06:10:19 +00:00
parent 20959f84ae
commit 9261aa193b
3 changed files with 67 additions and 39 deletions

25
docker-install-tini.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
# Figure out latest release via GitHub API
release=$(curl --silent "https://api.github.com/repos/krallin/tini/releases/latest" | jq -r .tag_name)
# _Reliable_ way to get which arch for tini download
arch=$(python <<EOF
from __future__ import print_function
import platform
processor = platform.machine()
if processor == 'aarch64':
print('arm64', end='')
elif processor == 'x86 64' or processor == 'x86_64':
print('amd64', end='')
elif processor == 'armv7l':
print('armhf', end='')
EOF
)
# Download/install tini
curl -L https://github.com/krallin/tini/releases/download/$release/tini-static-$arch \
-o /sbin/tini
chmod a+x /sbin/tini