Skip to content

Commit 3764ba4

Browse files
authored
Merge pull request #2 from gentslava/feature/alpine
Alpine Docker image
2 parents c48ac46 + 45e7ea6 commit 3764ba4

File tree

2 files changed

+81
-11
lines changed

2 files changed

+81
-11
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: MultiArchDockerFeature
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/*
7+
8+
jobs:
9+
docker:
10+
name: Build multi-arch Docker image.
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: tag number
14+
run : echo ${{ github.event.release.tag_name }}
15+
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
id: buildx
24+
uses: docker/setup-buildx-action@v3
25+
with:
26+
install: true
27+
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Login to GitHub Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Set lower case owner name
42+
run: |
43+
echo "REG_REPO=${REPO,,}" >> ${GITHUB_ENV}
44+
env:
45+
REPO: '${{ github.repository }}'
46+
47+
- name: Check env
48+
run: |
49+
echo ${{ env.REG_REPO }}
50+
51+
- name: Build and push
52+
uses: docker/build-push-action@v5
53+
with:
54+
context: .
55+
platforms: linux/amd64,linux/arm64,linux/arm/v7
56+
push: true
57+
tags: |
58+
${{ secrets.DOCKERHUB_USERNAME }}/jacred:feature
59+
ghcr.io/${{ env.REG_REPO }}:feature
60+
cache-from: type=gha,scope=${{ github.workflow }}
61+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

Dockerfile

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
# ### BUILD MAIN IMAGE START ###
2-
FROM ubuntu
1+
### BUILD JACRED MULTIARCH START ###
2+
FROM --platform=$BUILDPLATFORM alpine AS builder
3+
4+
WORKDIR /app
35

4-
RUN apt update && apt -y install curl systemd tor tor-geoipdb privoxy
5-
COPY ./privoxy.config /etc/privoxy/config
6+
# Get and unpack JacRed
7+
RUN apk --no-cache --update add bash wget unzip
8+
RUN wget https://github.com/immisterio/jacred-fdb/releases/latest/download/publish.zip
9+
RUN unzip -o publish.zip
10+
RUN rm -f publish.zip
11+
### BUILD JACRED MULTIARCH END ###
12+
13+
# ### BUILD MAIN IMAGE START ###
14+
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
615

7-
COPY ./install.sh /
8-
COPY ./update.sh /
16+
ENV JACRED_HOME=/home/jacred
17+
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
918

10-
RUN sh /install.sh
19+
COPY --from=builder /app $JACRED_HOME/
1120

12-
WORKDIR /home/jacred
21+
RUN apk --no-cache --update add icu-libs
1322

14-
RUN crontab Data/crontab
23+
WORKDIR $JACRED_HOME
1524

1625
EXPOSE 9117
1726

18-
VOLUME [ "/home/jacred/init.conf", "/home/jacred/Data" ]
27+
VOLUME [ "$JACRED_HOME/init.conf", "$JACRED_HOME/Data" ]
1928

20-
ENTRYPOINT ["/lib/systemd/systemd"]
29+
ENTRYPOINT ["dotnet", "JacRed.dll"]
2130
### BUILD MAIN IMAGE end ###

0 commit comments

Comments
 (0)