From a56dfa7fa1217c9c39ca7efe98cc83b27a88ab44 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Apr 2022 22:45:46 -0500 Subject: reorder directives to improve cacheability (maybe?) --- Dockerfile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9512839..a1b2a921 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,28 +38,17 @@ ARG VERSION=0.0.1.65534-local ARG REVISION=0 ARG BUILD_DATE -LABEL org.opencontainers.image.title=slskd \ - org.opencontainers.image.description="A modern client-server application for the Soulseek file sharing network" \ - org.opencontainers.image.authors="slskd Team" \ - org.opencontainers.image.vendor="slskd Team" \ - org.opencontainers.image.licenses=AGPL-3.0 \ - org.opencontainers.image.url=https://slskd.org \ - org.opencontainers.image.source=https://github.com/slskd/slskd \ - org.opencontainers.image.documentation=https://github.com/slskd/slskd \ - org.opencontainers.image.version=$VERSION \ - org.opencontainers.image.revision=$REVISION \ - org.opencontainers.image.created=$BUILD_DATE - RUN apt-get update && apt-get install -y \ wget \ && rm -rf /var/lib/apt/lists/* -WORKDIR /slskd -COPY --from=publish /slskd/dist/${TARGETPLATFORM} . - RUN bash -c 'mkdir -p /app/{incomplete,downloads} \ && chmod -R 777 /app' +VOLUME /app + +HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O - http://localhost:${SLSKD_HTTP_PORT}/health + ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/tmp/.net \ SLSKD_HTTP_PORT=5000 \ SLSKD_HTTPS_PORT=5001 \ @@ -70,8 +59,19 @@ ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/tmp/.net \ SLSKD_DOCKER_REVISON=$REVISION \ SLSKD_DOCKER_BUILD_DATE=$BUILD_DATE -VOLUME /app +LABEL org.opencontainers.image.title=slskd \ + org.opencontainers.image.description="A modern client-server application for the Soulseek file sharing network" \ + org.opencontainers.image.authors="slskd Team" \ + org.opencontainers.image.vendor="slskd Team" \ + org.opencontainers.image.licenses=AGPL-3.0 \ + org.opencontainers.image.url=https://slskd.org \ + org.opencontainers.image.source=https://github.com/slskd/slskd \ + org.opencontainers.image.documentation=https://github.com/slskd/slskd \ + org.opencontainers.image.version=$VERSION \ + org.opencontainers.image.revision=$REVISION \ + org.opencontainers.image.created=$BUILD_DATE -HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O - http://localhost:${SLSKD_HTTP_PORT}/health +WORKDIR /slskd +COPY --from=publish /slskd/dist/${TARGETPLATFORM} . ENTRYPOINT ["./slskd"] \ No newline at end of file -- cgit v1.2.3 From 0592edd190f156d61f44136770dec00dd31fa9c0 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Apr 2022 23:00:44 -0500 Subject: tweak caching --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68630661..fa7a39bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,7 +142,7 @@ jobs: ghcr.io/slskd/slskd:${{ env.VERSION }} ghcr.io/slskd/slskd:canary cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push Release if: startsWith(github.ref, 'refs/tags/') @@ -162,7 +162,16 @@ jobs: ghcr.io/slskd/slskd:canary ghcr.io/slskd/slskd:latest cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + if: + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache release: name: Create Release -- cgit v1.2.3 From d9903c03528496639ecad478921bb97a47199a1b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Apr 2022 23:10:19 -0500 Subject: fix indent --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa7a39bf..895e76de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,14 +164,14 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - if: - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + if: + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache release: name: Create Release -- cgit v1.2.3