Skip to content

Commit

Permalink
fix docker build problem and added arm64 support
Browse files Browse the repository at this point in the history
fixed docker build problems on github actions everything is tested and working as expected
  • Loading branch information
AmirulAndalib committed Dec 26, 2022
1 parent 0611e3f commit 2614429
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
22 changes: 18 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2614429

Please sign in to comment.