From 2020f0edb722fce13a1acecc07cdc1795ed2f9c6 Mon Sep 17 00:00:00 2001 From: James Healy Date: Wed, 28 Oct 2020 00:28:15 +1100 Subject: [PATCH] on arm, install docker-compose via pip Sadly, there's no binary distribution for linux+arm yet: https://github.com/docker/compose/issues/7472 This is an imperfect solution, but it gets us going for now. --- packer/linux/conf/buildkite-agent/hooks/environment | 5 +++++ packer/linux/scripts/install-docker.sh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/packer/linux/conf/buildkite-agent/hooks/environment b/packer/linux/conf/buildkite-agent/hooks/environment index 6d58358a4..ad83b7aff 100755 --- a/packer/linux/conf/buildkite-agent/hooks/environment +++ b/packer/linux/conf/buildkite-agent/hooks/environment @@ -9,6 +9,11 @@ BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY=$(mktemp -d) export BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY export DOCKER_CONFIG="$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY" +# on linux/arm64 we have to install docker-compose via pip, which +# has a dependency on the cryptography package, which requires some +# convincing to run with the version of openssl distributed with Amazon Linux 2 +export CRYPTOGRAPHY_ALLOW_OPENSSL_102=true + echo "~~~ :llama: Setting up elastic stack environment ($BUILDKITE_STACK_VERSION)" cat ~/cfn-env diff --git a/packer/linux/scripts/install-docker.sh b/packer/linux/scripts/install-docker.sh index bef81f6d5..1b28c81d4 100755 --- a/packer/linux/scripts/install-docker.sh +++ b/packer/linux/scripts/install-docker.sh @@ -36,6 +36,10 @@ if [ ${MACHINE} == "x86_64" ]; then sudo curl -Lsf -o /usr/bin/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 sudo chmod +x /usr/bin/docker-compose docker-compose --version +elif [[ ${MACHINE} == "aarch64" ]]; then + sudo yum install -y gcc-c++ libffi-devel openssl-devel python3-devel + sudo pip3 install docker-compose + CRYPTOGRAPHY_ALLOW_OPENSSL_102=true docker-compose version fi echo "Adding docker cron tasks..."