From 261442990a1bd46465a6cdd63130c698d6291d5c Mon Sep 17 00:00:00 2001 From: AmirulAndalib Date: Mon, 26 Dec 2022 19:52:06 +0600 Subject: [PATCH 1/3] fix docker build problem and added arm64 support fixed docker build problems on github actions everything is tested and working as expected --- .github/workflows/beta.yml | 43 +++++++++++++++++++++++++++++--------- Dockerfile | 22 +++++++++++++++---- docker-compose.yml | 2 +- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a4a1eb0..74bdc45 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -4,27 +4,50 @@ on: push: branches: - 'beta' + workflow_dispatch: +env: + IMAGE: todrob/searcharr jobs: docker: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - + uses: actions/checkout@v2 - name: Login to DockerHub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - + - if: startsWith(github.ref, 'refs/heads/master') + run: echo "TAG=latest" >> $GITHUB_ENV + - if: startsWith(github.ref, 'refs/tags') + run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV + - name: upgrade apt packages.. + run: sudo apt-get update -y && sudo apt-get upgrade -y + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push uses: docker/build-push-action@v3 with: - platforms: linux/amd64,linux/arm64,linux/arm/v7 + context: ./ + file: ./Dockerfile push: true - tags: toddrob/searcharr:beta + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: todrob/searcharr:beta + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: todrob/searcharr + short-description: ${{ github.event.repository.description }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9fd31c8..2b2f3dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,25 @@ -FROM python:3.11-slim-buster +FROM python:slim + +LABEL org.opencontainers.image.source="https://github.com/toddrob99/searcharr" +LABEL org.opencontainers.image.description="Docker for SEARCHARR" +LABEL Name=Searcharr Version="v1.2-beta" + +ARG TARGETPLATFORM BUILDPLATFORM -LABEL Name=Searcharr Version=1.2 WORKDIR /app + +RUN chmod -R 777 /app && \ + chmod -R +x /app && \ + chmod -R 705 /app + ADD . /app -RUN python3 -m pip install --upgrade pip -RUN python3 -m pip install -r requirements.txt +RUN apt-get update -y && \ + apt-get upgrade -y + +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install -r requirements.txt && \ + apt-get autoremove -y CMD ["python3", "searcharr.py"] diff --git a/docker-compose.yml b/docker-compose.yml index d89f6f9..66af793 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.0' services: searcharr: container_name: searcharr - image: toddrob/searcharr:latest + image: toddrob/searcharr:beta volumes: - ./data:/app/data - ./logs:/app/logs From a71366b464244a76d0cc7dc4aecede3eb6ecf940 Mon Sep 17 00:00:00 2001 From: AmirulAndalib Date: Fri, 30 Dec 2022 21:56:17 +0600 Subject: [PATCH 2/3] minor typo fixes --- .github/workflows/beta.yml | 10 +++++----- Dockerfile | 2 +- docker-compose.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 74bdc45..b122435 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - IMAGE: todrob/searcharr + IMAGE: toddrob/searcharr jobs: docker: runs-on: ubuntu-22.04 @@ -41,13 +41,13 @@ jobs: context: ./ file: ./Dockerfile push: true - platforms: linux/amd64,linux/arm64,linux/arm/v7 - tags: todrob/searcharr:beta + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 + tags: toddrob/searcharr:latest - name: Docker Hub Description uses: peter-evans/dockerhub-description@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: todrob/searcharr - short-description: ${{ github.event.repository.description }} \ No newline at end of file + repository: toddrob/searcharr + short-description: ${{ github.event.repository.description }} diff --git a/Dockerfile b/Dockerfile index 2b2f3dd..371e587 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:slim LABEL org.opencontainers.image.source="https://github.com/toddrob99/searcharr" LABEL org.opencontainers.image.description="Docker for SEARCHARR" -LABEL Name=Searcharr Version="v1.2-beta" +LABEL Name=Searcharr Version="v1.2" ARG TARGETPLATFORM BUILDPLATFORM diff --git a/docker-compose.yml b/docker-compose.yml index 66af793..f9d0bcc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.0' services: searcharr: container_name: searcharr - image: toddrob/searcharr:beta + build: . volumes: - ./data:/app/data - ./logs:/app/logs From 8db0019b12c2d05770333941cac231bdc86e2962 Mon Sep 17 00:00:00 2001 From: Amirul Islam Date: Fri, 30 Dec 2022 22:28:09 +0600 Subject: [PATCH 3/3] minor fixes --- .github/workflows/beta.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index b122435..49dc878 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -43,11 +43,3 @@ jobs: push: true platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 tags: toddrob/searcharr:latest - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: toddrob/searcharr - short-description: ${{ github.event.repository.description }}