-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3d6280
commit a7252d9
Showing
4 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Publish Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
release: | ||
types: [prereleased,released] | ||
|
||
|
||
jobs: | ||
|
||
|
||
publish-docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare Tag | ||
# Borrowed from daeuniverse/dae | ||
id: prep | ||
env: | ||
REF: ${{ github.ref }} | ||
run: | | ||
if [[ "$REF" == "refs/tags/v"* ]]; then | ||
tag=$(git describe --tags $(git rev-list --tags --max-count=1)) | ||
tag=${tag:1} | ||
else | ||
tag=$(git log -1 --format="%cd" --date=short | sed s/-//g) | ||
fi | ||
echo "IMAGE=daeuniverse/dae-wing" >> $GITHUB_OUTPUT | ||
echo "TAG=$tag" >> $GITHUB_OUTPUT | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
id: buildx | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to ghrc.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to quay.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.QUAY_PASS }} | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
build-args: VERSION=${{ steps.prep.outputs.TAG }} | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: | | ||
${{ github.repository }}:latest | ||
${{ github.repository }}:${{ steps.prep.outputs.TAG }} | ||
ghcr.io/${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository }}:${{ steps.prep.outputs.TAG }} | ||
quay.io/${{ github.repository }}:latest | ||
quay.io/${{ github.repository }}:${{ steps.prep.outputs.TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# wing/Dockerfile | ||
FROM golang:1.21-bookworm as builder | ||
|
||
WORKDIR /build | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y git make llvm-15 clang-15 | ||
|
||
ENV CGO_ENABLED=0 | ||
ENV CLANG=clang-15 | ||
ARG VERSION=self-build | ||
|
||
COPY . . | ||
|
||
RUN make APPNAME=dae-wing VERSION=$VERSION | ||
|
||
FROM alpine | ||
|
||
WORKDIR /etc/dae-wing | ||
|
||
RUN mkdir -p /usr/local/share/dae-wing | ||
RUN wget -O /usr/local/share/dae-wing/geoip.dat https://github.com/v2rayA/dist-v2ray-rules-dat/raw/master/geoip.dat | ||
RUN wget -O /usr/local/share/dae-wing/geosite.dat https://github.com/v2rayA/dist-v2ray-rules-dat/raw/master/geosite.dat | ||
COPY --from=builder /build/dae-wing /usr/local/bin | ||
|
||
EXPOSE 2023 | ||
|
||
CMD ["dae-wing"] | ||
ENTRYPOINT ["dae-wing", "run", "-c", "."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3' | ||
|
||
services: | ||
dae-wing: | ||
privileged: true | ||
network_mode: host | ||
pid: host | ||
build: . | ||
container_name: dae-wing | ||
volumes: | ||
- /sys:/sys | ||
- /etc/dae-wing:/etc/dae-wing |