From 1b2be12656d694586ecf4b3d9c2061d89065870c Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:53:00 -0500 Subject: [PATCH 01/14] feat: update docker ## tl;dr Refactored both the dockerfile and docker-compose files to improve performance, build size/caching, and maintainability. ## High level changes - `docker-compose*.yml` - container name - build context and dockerfile - hostname - platform w/fallback - read .env for platform and sane compose defaults - explicit bridge network - workdir - `Dockerfile` - set syntax (future proof w/heredocs and interpolation) - pin image - multistage builder - pip, python, and local env vars - clean up build deps from apk - update pip before installing requirements - copy build deps to runner stage - set workdir (overridden by compose) - label for github actions builds - `docker.yml` - CI to build the docker image and push to either ghcr.io by default or dockerhub when `REGISTRY_URL` is set to docker.io - `docker-entrypoint.sh` - get interpreter from env - remove bashisms (posix sh) - double quote cli args to avoid word splitting - `.dockerignore`: add exclusions - `.env.example` - set compose file name (useful for multiple compose files) - remove orphans by default - platform for local builds on arm - `.dive-ci`: analyze image to reduce build size - `.hadolint.yaml`: lint Dockerfile --- .dive-ci | 4 ++ .dockerignore | 14 +++++- .env.example | 4 ++ .github/workflows/docker.yml | 94 ++++++++++++++++++++++++++++++++++++ .hadolint.yaml | 12 +++++ Dockerfile | 81 +++++++++++++++++++++++-------- docker-compose.example.yml | 17 ++++++- docker-entrypoint.sh | 6 +-- 8 files changed, 206 insertions(+), 26 deletions(-) create mode 100644 .dive-ci create mode 100644 .env.example create mode 100644 .github/workflows/docker.yml create mode 100644 .hadolint.yaml diff --git a/.dive-ci b/.dive-ci new file mode 100644 index 000000000..2cdb78474 --- /dev/null +++ b/.dive-ci @@ -0,0 +1,4 @@ +rules: + lowestEfficiency: 0.97 # ratio between 0-1 + highestWastedBytes: 20MB # B, KB, MB, and GB + highestUserWastedPercent: 0.20 # ratio between 0-1 diff --git a/.dockerignore b/.dockerignore index 3af66447e..af8cd8e1c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,12 @@ +# ETC +.dive-ci +.editorconfig +.env +.hadolint.yaml +**/*.example +**/*.md +LICENSE + # Runtime audio_cache/ bin/ @@ -8,13 +17,16 @@ musicbot/lib/__pycache__/ # Docker .dockerignore +docker-compose.example.yml +docker-compose.yml Dockerfile # Git .git/ .gitattributes +.github/ .gitignore # IDE .idea/ -.vscode/ \ No newline at end of file +.vscode/ diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..5c9ab2cb8 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +COMPOSE_FILE=docker-compose.yml +COMPOSE_REMOVE_ORPHANS=true +# * Options: linux/amd64 / linux/arm64/v8 +PLATFORM=linux/arm64/v8 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..ae6020b5b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,94 @@ +name: Publish Docker images + +on: + push: + branches: + - 'main' + - 'master' + tags: + - '*.*.*' + paths: + - '.dockerignore' + - '.env.example' + - '.github/workflows/**' + - '**.bat' + - '**.ps1' + - '**.py' + - '**.sh' + - 'bin/**' + - 'config/**' + - 'Dockerfile*' + - 'musicbot.service' + - 'musicbot/**' + - 'musicbotcmd' + - 'poetry.lock' + - 'pyproject.toml' + - 'requirements.txt' + workflow_dispatch: + +env: + REGISTRY_URL: ${{ vars.REGISTRY_URL }} + REGISTRY_USER: ${{ vars.REGISTRY_USER }} + REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }} + +jobs: + push_to_registry: + name: Push Docker image to container registry + runs-on: ubuntu-latest + strategy: + matrix: + dockerfile: [Dockerfile] + concurrency: + group: ${{ github.workflow }}-${{ matrix.dockerfile }}-${{ github.ref }} + cancel-in-progress: true + permissions: + packages: write + contents: read + actions: read + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log into container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_URL }} + username: ${{ env.REGISTRY_URL == 'ghcr.io' && github.repository_owner || env.REGISTRY_USER }} + password: ${{ env.REGISTRY_URL == 'ghcr.io' && secrets.GITHUB_TOKEN || env.REGISTRY_PASS }} + + - name: Extract image name from Dockerfile + id: image_name + run: | + IMAGE=$(grep "LABEL org.opencontainers.image.title" ${{ matrix.dockerfile }} | cut -d'"' -f2) + echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_URL == 'ghcr.io' && github.repository_owner || env.REGISTRY_USER }}/${{ steps.image_name.outputs.IMAGE }} + tags: | + type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') || endsWith(github.ref, 'master') }} + type=ref,event=branch,enable=${{ !endsWith(github.ref, 'main') && !endsWith(github.ref, 'master') }} + type=semver,pattern={{version}} + flavor: | + latest=false + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./${{ matrix.dockerfile }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64/v8 + cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} + cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 000000000..44549a02a --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,12 @@ +failure-threshold: info # error|warning|info|style|ignore|none + +ignored: + - DL3008 # pin versions in apt + - DL3013 # pin versions in pip + - DL3018 # pin versions in apk + - DL3042 # pip --no-cache-dir + +trustedRegistries: + - docker.io + - "*.gcr.io" + - localhost:32000 diff --git a/Dockerfile b/Dockerfile index d2e022da4..c17c1ae79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,68 @@ -FROM python:3.8-alpine +# syntax=docker/dockerfile:1.7.0 -# Add project source -WORKDIR /musicbot -COPY . ./ -COPY ./config sample_config +# Build stage +FROM python:3.8-alpine3.20 AS builder + +# pip env vars +ENV PIP_NO_CACHE_DIR=off +ENV PIP_DISABLE_PIP_VERSION_CHECK=on +ENV PIP_DEFAULT_TIMEOUT=100 + +# standardise on locale, don't generate .pyc, enable tracebacks on seg faults +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONFAULTHANDLER=1 + +# set locale +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 # Install build dependencies -RUN apk update && apk add --no-cache --virtual .build-deps \ - build-base \ - libffi-dev \ - libsodium-dev +RUN apk update && apk add --no-cache \ + build-base \ + libffi-dev \ + libsodium-dev \ + git \ + && rm -rf /var/cache/apk/* + +WORKDIR /app + +# Install pip and dependencies +COPY requirements.txt . +RUN python -m pip install --no-cache-dir --upgrade pip \ + && python -m pip install --no-cache-dir -r requirements.txt -# Install dependencies +# Final stage +FROM python:3.8-alpine3.20 AS runner + +# pip env vars +ENV PIP_NO_CACHE_DIR=off +ENV PIP_DISABLE_PIP_VERSION_CHECK=on +ENV PIP_DEFAULT_TIMEOUT=100 + +# standardise on locale, don't generate .pyc, enable tracebacks on seg faults +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONFAULTHANDLER=1 + +# set locale +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# Install runtime dependencies RUN apk update && apk add --no-cache \ - ca-certificates \ - ffmpeg \ - opus-dev \ - libffi \ - libsodium \ - gcc \ - git + libffi \ + libsodium \ + ffmpeg \ + opus \ + git \ + && rm -rf /var/cache/apk/* -# Install pip dependencies -RUN pip3 install --no-cache-dir -r requirements.txt +# Copy only necessary files from builder stage +COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin -# Clean up build dependencies -RUN apk del .build-deps +WORKDIR /musicbot +COPY . . +COPY ./config sample_config # Create volumes for audio cache, config, data and logs VOLUME ["/musicbot/audio_cache", "/musicbot/config", "/musicbot/data", "/musicbot/logs"] @@ -33,3 +70,5 @@ VOLUME ["/musicbot/audio_cache", "/musicbot/config", "/musicbot/data", "/musicbo ENV APP_ENV=docker ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"] + +LABEL org.opencontainers.image.title="musicbot" diff --git a/docker-compose.example.yml b/docker-compose.example.yml index b957eb17d..c6cc776d4 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -1,8 +1,23 @@ services: musicbot: - build: . + container_name: musicbot + build: + context: . + dockerfile: Dockerfile + hostname: musicbot + platform: ${PLATFORM:-linux/amd64} + env_file: + - .env volumes: - ./config:/musicbot/config/ - ./audio_cache:/musicbot/audio_cache - ./data:/musicbot/data - ./logs:/musicbot/logs + networks: + - musicbot + working_dir: /musicbot + +networks: + musicbot: + name: musicbot + driver: bridge diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 0a308e40b..b6e7488b0 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/usr/bin/env sh -if [[ ! -f "/musicbot/config/example_options.ini" ]]; then +if [ ! -f "/musicbot/config/example_options.ini" ]; then cp -r /musicbot/sample_config/* /musicbot/config fi -exec python3 run.py $@ +exec python3 run.py "$@" From 2703334de2fa7fd7c61fc24215ed1b742af3599e Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:53:58 -0500 Subject: [PATCH 02/14] chore: update .gitignore - descriptions of exclusions/inclusion - included .env.example for docker builds --- .gitignore | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index fcf24c5fd..69b45b488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,24 @@ +# editor settings .idea/ +.vscode/ + +# python bytecode *.pyc + +# temp files ~*/ -.vscode/ +# directories audio_cache/ dectalk/ - -discord.log logs/ data/ +media/ + +# logs +discord.log + +# configs config/options.ini config/permissions.ini config/aliases.json @@ -20,7 +30,10 @@ config/blacklist.txt config/blocklist_users.txt config/blocklist_songs.txt config/playlists/ -media/ +config/autoplaylist.cachemap.json +# docker docker-compose.yml -config/autoplaylist.cachemap.json + +# includsions (has to be declared last) +!**/*.example From c606ed5ddcdca39f25359f49e431f165a65d236f Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:55:23 -0500 Subject: [PATCH 03/14] ci: add .editorconfig This one is optional, but I've found editorconfig to be invaluable when working on projects with more than two devs. Happy to remove or edit per the maintainers. https://EditorConfig.org --- .editorconfig | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..3841c41dd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines and whitespace cleanup +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +insert_final_newline = true + +# Protect whitespace in markdown files +[*.md] +trim_trailing_whitespace = false + +# general formatting +[*.{bash,go,sh,zsh,justfile,Makefile}] +indent_style = tab +indent_size = 4 + +# Set default charset +[*.{html,xml,js,css,py}] +charset = utf-8 + +# python +[*.py] +indent_style = space +indent_size = 4 + +# webdev et al +[*.{html,xml,js,mjs,css,json,jsonc,gql,lua,tf,tfvars,yml,yaml}] +indent_style = space +indent_size = 2 From 0caf4aec5c07e3e3e448c59671f5e5a2c3611258 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:00:36 -0500 Subject: [PATCH 04/14] chore: fix typo --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 69b45b488..02d8bb91d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,5 +35,5 @@ config/autoplaylist.cachemap.json # docker docker-compose.yml -# includsions (has to be declared last) +# inclusions (has to be declared last) !**/*.example From 021a2a56089e4bf60d9278a8c62f36ee0355f831 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:31:19 -0500 Subject: [PATCH 05/14] ci: temporarily add feature branches --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ae6020b5b..c9711cd2b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,6 +5,7 @@ on: branches: - 'main' - 'master' + - 'feat/**' tags: - '*.*.*' paths: From 1044091cd0c3d747cdf037adf9c5a3c4b5c807b5 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:01:10 -0500 Subject: [PATCH 06/14] fix: overzealous package removal - opus-dev and ca-certificates reinstated - sorted runtime deps - changed builder workdir to match runner --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c17c1ae79..10ab54317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN apk update && apk add --no-cache \ git \ && rm -rf /var/cache/apk/* -WORKDIR /app +WORKDIR /musicbot # Install pip and dependencies COPY requirements.txt . @@ -49,11 +49,12 @@ ENV LC_ALL=C.UTF-8 # Install runtime dependencies RUN apk update && apk add --no-cache \ - libffi \ - libsodium \ + ca-certificates \ ffmpeg \ - opus \ git \ + libffi \ + libsodium \ + opus-dev \ && rm -rf /var/cache/apk/* # Copy only necessary files from builder stage From a929dc54d6d132ea0e59373c286ace2943e7776e Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:08:02 -0500 Subject: [PATCH 07/14] chore: add image description --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 10ab54317..72c2bccab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,3 +73,4 @@ ENV APP_ENV=docker ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"] LABEL org.opencontainers.image.title="musicbot" +LABEL org.opencontainers.image.description "The original MusicBot for Discord" From 58ad6af9c5c1c347ef312778d442ab15729e69e7 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:13:08 -0500 Subject: [PATCH 08/14] ci: fix tags for branches and SHAs --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c9711cd2b..45b69044f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -70,8 +70,8 @@ jobs: images: | ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_URL == 'ghcr.io' && github.repository_owner || env.REGISTRY_USER }}/${{ steps.image_name.outputs.IMAGE }} tags: | - type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') || endsWith(github.ref, 'master') }} - type=ref,event=branch,enable=${{ !endsWith(github.ref, 'main') && !endsWith(github.ref, 'master') }} + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} + type=ref,event=branch type=semver,pattern={{version}} flavor: | latest=false From a48a4328d157bf65aca353b7a32af77758296db5 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:21:16 -0500 Subject: [PATCH 09/14] ci: Extract description from Dockerfile --- .github/workflows/docker.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 45b69044f..307e855b7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -82,6 +82,16 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Extract description from Dockerfile + id: dockerfile_description + run: | + DESCRIPTION=$(grep "LABEL org.opencontainers.image.description" ${{ matrix.dockerfile }} | cut -d'"' -f2 || echo "") + if [ -z "$DESCRIPTION" ]; then + DESCRIPTION="No description provided" + echo "Warning: No description found in Dockerfile. Using default." >&2 + fi + echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_OUTPUT + - name: Build and push Docker image uses: docker/build-push-action@v6 with: @@ -93,3 +103,5 @@ jobs: platforms: linux/amd64,linux/arm64/v8 cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max + annotations: | + org.opencontainers.image.description=${{ steps.dockerfile_description.outputs.DESCRIPTION }} From 4b621a07e6a681f86c4746b8563d8d657a0f2468 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:27:41 -0500 Subject: [PATCH 10/14] ci: reorder jobs, use builtin metadata method from build-push-action --- .github/workflows/docker.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 307e855b7..54b190cbc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -76,12 +76,6 @@ jobs: flavor: | latest=false - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Extract description from Dockerfile id: dockerfile_description run: | @@ -92,6 +86,12 @@ jobs: fi echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_OUTPUT + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image uses: docker/build-push-action@v6 with: @@ -103,5 +103,6 @@ jobs: platforms: linux/amd64,linux/arm64/v8 cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max - annotations: | - org.opencontainers.image.description=${{ steps.dockerfile_description.outputs.DESCRIPTION }} + outputs: | + type=image,name=${{ steps.meta.outputs.tags }},annotation-index.org.opencontainers.image.description=${{ steps.dockerfile_description.outputs.DESCRIPTION }} + From 8103b9710ca5849c806de7e1ff79b5bd194a7bdb Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:34:57 -0500 Subject: [PATCH 11/14] ci (refactor): use json metadata for description Gets description from repo instead of dockerfile --- .github/workflows/docker.yml | 16 +++------------- Dockerfile | 1 - 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 54b190cbc..68c9790e6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -76,16 +76,6 @@ jobs: flavor: | latest=false - - name: Extract description from Dockerfile - id: dockerfile_description - run: | - DESCRIPTION=$(grep "LABEL org.opencontainers.image.description" ${{ matrix.dockerfile }} | cut -d'"' -f2 || echo "") - if [ -z "$DESCRIPTION" ]; then - DESCRIPTION="No description provided" - echo "Warning: No description found in Dockerfile. Using default." >&2 - fi - echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_OUTPUT - - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -103,6 +93,6 @@ jobs: platforms: linux/amd64,linux/arm64/v8 cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max - outputs: | - type=image,name=${{ steps.meta.outputs.tags }},annotation-index.org.opencontainers.image.description=${{ steps.dockerfile_description.outputs.DESCRIPTION }} - + outputs: > + type=image,name=${{ steps.meta.outputs.tags }}, + annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }} diff --git a/Dockerfile b/Dockerfile index 72c2bccab..10ab54317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,4 +73,3 @@ ENV APP_ENV=docker ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"] LABEL org.opencontainers.image.title="musicbot" -LABEL org.opencontainers.image.description "The original MusicBot for Discord" From 1647ac021742810126166af55c83a89b9cc9c427 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:41:07 -0500 Subject: [PATCH 12/14] chore: add todo items --- .github/workflows/docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 68c9790e6..4d70a0b33 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -82,6 +82,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + # TODO: fix tagging + # ! 'manifest unknown' via `docker pull ghcr.io/pythoninthegrass/musicbot:feat-update_docker` + # ! `docker pull ghcr.io/pythoninthegrass/musicbot@sha256:40b2474ed9a12a7276196e1e09956c2b94ddd379ba46c6859ed40740ea41039a` works + # ! annotations also only apply to sha256 -- not 'branch/tag' versions - name: Build and push Docker image uses: docker/build-push-action@v6 with: From 4549973d782ba680074f117fbe95a0b9c652ed0e Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:45:48 -0500 Subject: [PATCH 13/14] chore: enable latest tag --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4d70a0b33..0724fd7db 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -74,7 +74,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} flavor: | - latest=false + latest=true - name: Set up QEMU uses: docker/setup-qemu-action@v3 From bd4ed235b1a15d107cebac0d109321c603338483 Mon Sep 17 00:00:00 2001 From: pythoninthegrass <4097471+pythoninthegrass@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:48:48 -0500 Subject: [PATCH 14/14] ci (fix): revert latest tag on feature branches --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0724fd7db..4d70a0b33 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -74,7 +74,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} flavor: | - latest=true + latest=false - name: Set up QEMU uses: docker/setup-qemu-action@v3