-
Notifications
You must be signed in to change notification settings - Fork 63
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
Showing
2 changed files
with
80 additions
and
0 deletions.
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,52 @@ | ||
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images | ||
# https://github.com/daeuniverse/dae/blob/main/.github/workflows/docker.yml | ||
|
||
name: "Build dae Docker image" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "dae/docker" | ||
- ".github/workflows/dae-docker-build.yml" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker images to ghcr.io | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: dae | ||
file: ./dae/docker/Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/arm/v7,linux/arm64,linux/amd64,linux/386 | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/dae:v0.6.0 | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/dae:latest | ||
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,28 @@ | ||
# https://github.com/daeuniverse/dae/blob/main/Dockerfile | ||
# https://github.com/tailscale/tailscale/blob/main/Dockerfile | ||
|
||
FROM golang:1.22-bookworm AS build-env | ||
|
||
WORKDIR /build/ | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y llvm-15 clang-15 git make | ||
ENV CLANG=clang-15 | ||
|
||
RUN git clone -b 'v0.6.0' --single-branch --depth 1 --recurse-submodules https://github.com/daeuniverse/dae.git . \ | ||
&& go mod download \ | ||
&& make OUTPUT=dae GOFLAGS="-buildvcs=false" CC=clang CGO_ENABLED=0 | ||
|
||
FROM alpine:3.18 | ||
|
||
RUN mkdir -p /usr/local/share/dae/ /etc/dae/ \ | ||
&& wget -O /usr/local/share/dae/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat \ | ||
&& wget -O /usr/local/share/dae/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \ | ||
#&& apk add --no-cache ca-certificates iptables iproute2 ip6tables \ | ||
&& command -v nft >/dev/null || apk add --no-cache nftables | ||
|
||
COPY --from=build-env /build/dae /usr/local/bin | ||
COPY --from=build-env /build/install/empty.dae /etc/dae/config.dae | ||
RUN chmod 0600 /etc/dae/config.dae | ||
|
||
ENTRYPOINT ["dae", "run", "-c", "/etc/dae/config.dae"] |