Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/feature_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: MultiArchDockerFeature

on:
push:
branches:
- feature/*

jobs:
docker:
name: Build multi-arch Docker image.
runs-on: ubuntu-latest
steps:
- name: tag number
run : echo ${{ github.event.release.tag_name }}

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set lower case owner name
run: |
echo "REG_REPO=${REPO,,}" >> ${GITHUB_ENV}
env:
REPO: '${{ github.repository }}'

- name: Check env
run: |
echo ${{ env.REG_REPO }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/jacred:feature
ghcr.io/${{ env.REG_REPO }}:feature
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
31 changes: 20 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
# ### BUILD MAIN IMAGE START ###
FROM ubuntu
### BUILD JACRED MULTIARCH START ###
FROM --platform=$BUILDPLATFORM alpine AS builder

WORKDIR /app

RUN apt update && apt -y install curl systemd tor tor-geoipdb privoxy
COPY ./privoxy.config /etc/privoxy/config
# Get and unpack JacRed
RUN apk --no-cache --update add bash wget unzip
RUN wget https://github.com/immisterio/jacred-fdb/releases/latest/download/publish.zip
RUN unzip -o publish.zip
RUN rm -f publish.zip
### BUILD JACRED MULTIARCH END ###

# ### BUILD MAIN IMAGE START ###
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine

COPY ./install.sh /
COPY ./update.sh /
ENV JACRED_HOME=/home/jacred
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

RUN sh /install.sh
COPY --from=builder /app $JACRED_HOME/

WORKDIR /home/jacred
RUN apk --no-cache --update add icu-libs

RUN crontab Data/crontab
WORKDIR $JACRED_HOME

EXPOSE 9117

VOLUME [ "/home/jacred/init.conf", "/home/jacred/Data" ]
VOLUME [ "$JACRED_HOME/init.conf", "$JACRED_HOME/Data" ]

ENTRYPOINT ["/lib/systemd/systemd"]
ENTRYPOINT ["dotnet", "JacRed.dll"]
### BUILD MAIN IMAGE end ###