diff --git a/shallow-server/Dockerfile b/shallow-server/Dockerfile index 593878a5..f0b87d73 100644 --- a/shallow-server/Dockerfile +++ b/shallow-server/Dockerfile @@ -21,7 +21,9 @@ COPY opcache-recommended.ini /usr/local/etc/php/conf.d/ WORKDIR /var/www/html -RUN rm -rf /var/www/html +# Looks like there's an issue on self-hosted runners with fuse-overlayfs that prevents us deleting the directory directly +# so rename it first and then remove it +RUN mv /var/www/html/ /var/www/html2/ && rm -rf /var/www/html2/ RUN mkdir -p /var/www/html RUN git clone --depth 1 https://github.com/nextcloud/server.git . diff --git a/shallow-server/initnc.sh b/shallow-server/initnc.sh index 5a3ab39a..823d67d8 100755 --- a/shallow-server/initnc.sh +++ b/shallow-server/initnc.sh @@ -5,6 +5,11 @@ export BRANCH=${BRANCH:=master} # Where we do all the work cd /var/www/html/ +# Run 'apt-get update' to unlock files. This seems neccessary on self hosted runners with fuse-overlayfs, +# otherwise git checkout will error out with 'file exists' error. Needs to be run here, doesn't work when +# done inside the Dockerfile +apt-get update + # Update code su www-data -c " git fetch --force --depth 1 origin $BRANCH:refs/remotes/origin/$BRANCH