feat: refactor Dockerfile

This commit is contained in:
2023-01-09 15:19:55 +01:00
parent d0fc1aca74
commit 31f683f766
3 changed files with 49 additions and 26 deletions
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -o errexit -o pipefail -o noclobber -o nounset
VERSION=${1:-"0.32.0"}
OS=${2:-linux}
ARCH=${3:-}
OS_ARCH=""
if [ "${ARCH}" == "amd64" ]; then
OS_ARCH="${OS}64"
elif [ "${ARCH}" == "arm64" ]; then
OS_ARCH="${OS}-aarch64"
fi
GH_URL="https://github.com/mozilla/geckodriver/releases/download/"
TMP_FILE="geckodriver.tar.gz"
curl -L -s \
-o ${TMP_FILE} \
"${GH_URL}v${VERSION}/geckodriver-v${VERSION}-${OS_ARCH}.tar.gz"
tar -xzf ${TMP_FILE}
mv geckodriver /usr/bin
rm ${TMP_FILE}