Skip to content

Commit

Permalink
fix caddy for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwen committed Oct 30, 2024
1 parent e669088 commit 6ad2b31
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/caddy-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
paths:
- 'caddy/**'
- '.github/workflows/caddy-build-push.yml'
workflow_dispatch: # Allow manual triggering
workflow_dispatch:

jobs:
build-and-push:
Expand All @@ -28,6 +28,8 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -51,7 +53,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
provenance: false
outputs: type=registry,push=true
tags: |
ghcr.io/${{ github.repository_owner }}/caddy:latest
ghcr.io/${{ github.repository_owner }}/caddy:2
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/singbox-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
name: Build and Push Sing-box Docker Image

# Disabled automatic builds - manual trigger only
on:
push:
branches: [ main ]
paths:
- 'singbox/**'
- '.github/workflows/singbox-build-push.yml'
pull_request:
branches: [ main ]
paths:
- 'singbox/**'
- '.github/workflows/singbox-build-push.yml'
workflow_dispatch: # Allow manual triggering
schedule:
- cron: '0 0 * * 0' # Run weekly to check for new sing-box versions
workflow_dispatch:

jobs:
build-and-push:
Expand All @@ -30,6 +19,8 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -52,8 +43,7 @@ jobs:
file: ./singbox/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
SINGBOX_VERSION=${{ env.SINGBOX_VERSION }}
provenance: false
tags: |
ghcr.io/${{ github.repository_owner }}/singbox:latest
ghcr.io/${{ github.repository_owner }}/singbox:${{ env.SINGBOX_VERSION }}
8 changes: 7 additions & 1 deletion caddy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN xcaddy build \
# Set GOARCH based on target platform
ARG TARGETOS
ARG TARGETARCH
ENV GOOS=$TARGETOS
ENV GOARCH=$TARGETARCH

RUN xcaddy build \
--with github.com/caddy-dns/cloudflare \
--with github.com/WeidiDeng/caddy-cloudflare-ip \
--with github.com/mholt/caddy-events-exec \
Expand Down

0 comments on commit 6ad2b31

Please sign in to comment.