forked from fscarmen/sing-box
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sing-box + Argo container is newly launched.
- Loading branch information
Showing
5 changed files
with
1,368 additions
and
4 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,38 @@ | ||
name: "Build and push images" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
name: "Build Sing-box image" | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
|
||
- name: Push images to Docker hub | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
platforms: linux/amd64, linux/arm64, linux/arm/v7 | ||
tags: ${{ env.DOCKERHUB_REPOSITORY }} |
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,27 @@ | ||
# 第一个阶段:使用 OpenSSL 生成证书文件 | ||
FROM alpine/openssl:latest AS openssl | ||
|
||
# 生成私钥和证书 | ||
RUN openssl ecparam -genkey -name prime256v1 -out /private.key && \ | ||
openssl req -new -x509 -days 36500 -key /private.key -out /cert.pem -subj "/CN=mozilla.org" | ||
|
||
# 第二个阶段:使用 Alpine 镜像并复制证书文件 | ||
FROM alpine:latest | ||
ARG TARGETARCH | ||
ENV ARCH=$TARGETARCH | ||
|
||
# 设置工作目录 | ||
WORKDIR /sing-box | ||
|
||
# 从第一个阶段的 OpenSSL 镜像中复制证书文件到当前镜像 | ||
COPY --from=openssl /private.key /sing-box/cert/private.key | ||
COPY --from=openssl /cert.pem /sing-box/cert/cert.pem | ||
COPY docker_init.sh /sing-box/init.sh | ||
|
||
RUN set -ex &&\ | ||
apk add --no-cache supervisor nginx bash &&\ | ||
mkdir -p /sing-box/conf /sing-box/subscribe /sing-box/logs &&\ | ||
chmod +x /sing-box/init.sh &&\ | ||
rm -rf /var/cache/apk/* | ||
|
||
CMD [ "./init.sh" ] |
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
Oops, something went wrong.