-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
10 changed files
with
156 additions
and
13 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,57 @@ | ||
name: Sing-box Docker Image CI | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get latest release | ||
id: get_release | ||
run: | | ||
latest_release=$(curl -Ls "https://api.github.com/repos/sagernet/sing-box/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') | ||
echo "latest_release: $latest_release" | ||
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
alireza7/s-ui-singbox | ||
ghcr.io/alireza0/s-ui-singbox | ||
tags: | | ||
type=sha | ||
type=pep440,pattern=${{ steps.get_release.outputs.latest_release }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: core/ | ||
push: true | ||
build-args: SINGBOX_VER=${{ steps.get_release.outputs.latest_release }} | ||
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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
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
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 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS singbox-builder | ||
LABEL maintainer="Alireza <alireza7@gmail.com>" | ||
WORKDIR /app | ||
ARG TARGETOS TARGETARCH | ||
ARG SINGBOX_VER=v1.8.10 | ||
ARG SINGBOX_TAGS="with_quic,with_grpc,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_v2ray_api,with_clash_api,with_gvisor" | ||
ARG GOPROXY="" | ||
ENV GOPROXY ${GOPROXY} | ||
ENV CGO_ENABLED=0 | ||
ENV GOOS=$TARGETOS | ||
ENV GOARCH=$TARGETARCH | ||
RUN apk --no-cache --update add build-base gcc wget unzip git | ||
RUN set -ex \ | ||
&& git clone --depth 1 --branch $SINGBOX_VER https://github.com/SagerNet/sing-box.git \ | ||
&& cd sing-box \ | ||
&& go build -v -trimpath -tags \ | ||
$SINGBOX_TAGS \ | ||
-ldflags "-X \"github.com/sagernet/sing-box/constant.Version=$SINGBOX_VER\" -s -w -buildid=" \ | ||
./cmd/sing-box | ||
|
||
FROM --platform=$BUILDPLATFORM alpine | ||
LABEL maintainer="Alireza <alireza7@gmail.com>" | ||
ENV TZ=Asia/Tehran | ||
WORKDIR /app | ||
RUN apk add --no-cache --update ca-certificates tzdata bash | ||
COPY --from=singbox-builder /app/sing-box/sing-box . | ||
COPY runSingbox.sh . | ||
ENTRYPOINT [ "./runSingbox.sh" ] |
File renamed without changes.
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,47 @@ | ||
--- | ||
version: "3" | ||
|
||
services: | ||
s-ui: | ||
image: alireza7/s-ui | ||
container_name: s-ui | ||
hostname: "S-UI docker" | ||
volumes: | ||
- "singbox:/app/bin" | ||
- "$PWD/db:/app/db" | ||
- "$PWD/cert:/app/cert" | ||
environment: | ||
SINGBOX_API: "sing-box:1080" | ||
SUI_DB_FOLDER: "db" | ||
tty: true | ||
restart: unless-stopped | ||
ports: | ||
- "2095:2095" | ||
- "2096:2096" | ||
networks: | ||
- s-ui | ||
entrypoint: "./sui" | ||
|
||
sing-box: | ||
image: alireza7/s-ui-singbox | ||
container_name: sing-box | ||
volumes: | ||
- "singbox:/app/" | ||
- "$PWD/cert:/cert" | ||
networks: | ||
- s-ui | ||
ports: | ||
- "443:443" | ||
- "1443:1443" | ||
- "2443:2443" | ||
- "3443:3443" | ||
restart: unless-stopped | ||
depends_on: | ||
- s-ui | ||
|
||
networks: | ||
s-ui: | ||
driver: bridge | ||
|
||
volumes: | ||
singbox: |