1
0

Use docker for arm64 on arm64

This commit is contained in:
nicolas.dorier
2020-02-16 22:54:41 +09:00
parent 0838cd5a7f
commit 3c6c7498e8

View File

@@ -384,7 +384,7 @@ if ! [[ -x "$(command -v docker)" ]] || ! [[ -x "$(command -v docker-compose)" ]
2>error
fi
if ! [[ -x "$(command -v docker)" ]]; then
if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]]; then
if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]] || [[ "$(uname -m)" == "aarch64" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OS
if ! [[ -x "$(command -v brew)" ]]; then
@@ -408,20 +408,9 @@ if ! [[ -x "$(command -v docker)" ]] || ! [[ -x "$(command -v docker-compose)" ]
sh get-docker.sh
rm get-docker.sh
fi
elif [[ "$(uname -m)" == "aarch64" ]]; then
echo "Trying to install docker for armv7 on a aarch64 board..."
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RELEASE=$(lsb_release -cs)
if [[ "$RELEASE" == "bionic" ]]; then
RELEASE=xenial
fi
if [[ -x "$(command -v dpkg)" ]]; then
dpkg --add-architecture armhf
fi
add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $RELEASE stable"
apt-get update -y
# zlib1g:armhf is needed for docker-compose, but we install it here as we changed dpkg here
apt-get install -y docker-ce:armhf zlib1g:armhf
else
echo "Unsupported architecture $(uname -m)"
return
fi
fi