From 837f05f3f06f1d32b160067631f2a3e30e49545d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 19 Dec 2021 18:17:13 +0100 Subject: [PATCH] Create 00-portainer_install.sh --- .../etc/cont-init.d/00-portainer_install.sh | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 portainer/rootfs/etc/cont-init.d/00-portainer_install.sh diff --git a/portainer/rootfs/etc/cont-init.d/00-portainer_install.sh b/portainer/rootfs/etc/cont-init.d/00-portainer_install.sh new file mode 100644 index 000000000..02a2d74de --- /dev/null +++ b/portainer/rootfs/etc/cont-init.d/00-portainer_install.sh @@ -0,0 +1,22 @@ +#!/bin/bash +if [ -e "/PORTFILE" ]; then + echo "Installing portainer..." + BUILD_UPSTREAM=$(cat /PORTFILE) + BUILD_ARCH=$(uname -m) + + echo "${BUILD_ARCH}" + BUILD_ARCH=${BUILD_ARCH:-x86} + + if [[ "${BUILD_ARCH}" == *aarch64* ]]; then ARCH="arm64"; fi + if [[ "${BUILD_ARCH}" == *armv8* ]]; then ARCH="arm64"; fi + if [[ "${BUILD_ARCH}" == *arm64* ]]; then ARCH="arm64"; fi + if [[ "${BUILD_ARCH}" == *armhf* ]]; then ARCH="arm"; fi + if [[ "${BUILD_ARCH}" == *armv7* ]]; then ARCH="arm"; fi + if [[ "${BUILD_ARCH}" == arm ]]; then ARCH="arm"; fi + if [[ "${BUILD_ARCH}" == *x86* ]]; then ARCH="amd64"; fi + + curl -L -s \ + "https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" \ + | tar zxvf - -C /opt/ + echo "... success!" + fi