diff --git a/Dockerfile b/Dockerfile index da98dc7..07436a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,20 +22,14 @@ RUN \ tar && \ echo "**** install heimdall ****" && \ mkdir -p \ - /var/www/localhost/heimdall && \ + /heimdall && \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /tmp/heimdall.tar.gz -L \ + /heimdall/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/heimdall.tar.gz -C \ - /var/www/localhost/heimdall --strip-components=1 && \ - echo "**** configure nginx ****" && \ - echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \ - /etc/nginx/fastcgi_params && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 48acce2..70e959f 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -22,20 +22,14 @@ RUN \ tar && \ echo "**** install heimdall ****" && \ mkdir -p \ - /var/www/localhost/heimdall && \ + /heimdall && \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /tmp/heimdall.tar.gz -L \ + /heimdall/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/heimdall.tar.gz -C \ - /var/www/localhost/heimdall --strip-components=1 && \ - echo "**** configure nginx ****" && \ - echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \ - /etc/nginx/fastcgi_params && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d6fc681..d254e9f 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -22,20 +22,14 @@ RUN \ tar && \ echo "**** install heimdall ****" && \ mkdir -p \ - /var/www/localhost/heimdall && \ + /heimdall && \ if [ -z ${HEIMDALL_RELEASE+x} ]; then \ HEIMDALL_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ - /tmp/heimdall.tar.gz -L \ + /heimdall/heimdall.tar.gz -L \ "https://github.com/linuxserver/Heimdall/archive/${HEIMDALL_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/heimdall.tar.gz -C \ - /var/www/localhost/heimdall --strip-components=1 && \ - echo "**** configure nginx ****" && \ - echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \ - /etc/nginx/fastcgi_params && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* diff --git a/README.md b/README.md index 22edd11..608fff5 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,7 @@ Below are the instructions for updating containers: ## Versions +* **26.03.19:** - Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **15.03.19:** - Clarify docker image tags in readme. * **22.02.19:** - Rebasing to alpine 3.9. diff --git a/readme-vars.yml b/readme-vars.yml index 1234310..1f8483a 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -49,6 +49,7 @@ app_setup_block: | # changelog changelogs: + - { date: "26.03.19:", desc: "Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "15.03.19:", desc: "Clarify docker image tags in readme." } - { date: "22.02.19:", desc: "Rebasing to alpine 3.9." } diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 1b012eb..de91aa6 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -2,7 +2,18 @@ # make our folders mkdir -p \ - /config/www/{backgrounds,icons,avatars,SupportedApps} + /config/www/{backgrounds,icons,avatars,SupportedApps} \ + /var/www/localhost/heimdall + +# install heimdall if necessary +[[ -f /heimdall/heimdall.tar.gz ]] && \ + echo "New container detected, installing Heimdall" && \ + tar xf \ + /heimdall/heimdall.tar.gz -C \ + /var/www/localhost/heimdall --strip-components=1 && \ + echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \ + /etc/nginx/fastcgi_params && \ + rm -rf /heimdall # create symlinks @@ -23,11 +34,13 @@ done # copy .env if not exists [[ ! -f /config/www/.env ]] && \ cp /var/www/localhost/heimdall/.env.example /config/www/.env && \ + echo "Creating app key. This may take a while on slower systems" php /var/www/localhost/heimdall/artisan key:generate # set queue driver to database sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env # permissions +echo "Setting permissions" chown -R abc:abc \ /config \ /var/www/localhost/heimdall