forked from XTLS/Xray-core
-
Notifications
You must be signed in to change notification settings - Fork 8
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
296 changed files
with
7,024 additions
and
5,699 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
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,22 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM --platform=$BUILDPLATFORM golang:alpine AS build | ||
WORKDIR /src | ||
COPY . . | ||
ARG TARGETOS TARGETARCH | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:latest | ||
WORKDIR /root | ||
COPY .github/docker/files/config.json /etc/xray/config.json | ||
COPY --from=build /src/xray /usr/bin/xray | ||
RUN set -ex \ | ||
&& apk add --no-cache tzdata ca-certificates \ | ||
&& mkdir -p /var/log/xray /usr/share/xray \ | ||
&& chmod +x /usr/bin/xray \ | ||
&& wget -O /usr/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \ | ||
&& wget -O /usr/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat | ||
|
||
VOLUME /etc/xray | ||
ENV TZ=Asia/Shanghai | ||
ENTRYPOINT [ "/usr/bin/xray" ] | ||
CMD [ "-config", "/etc/xray/config.json" ] |
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,18 @@ | ||
{ | ||
"inbounds": [{ | ||
"port": 9000, | ||
"protocol": "vmess", | ||
"settings": { | ||
"clients": [ | ||
{ | ||
"id": "1eb6e917-774b-4a84-aff6-b058577c60a5", | ||
"level": 1 | ||
} | ||
] | ||
} | ||
}], | ||
"outbounds": [{ | ||
"protocol": "freedom", | ||
"settings": {} | ||
}] | ||
} |
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,45 @@ | ||
name: Build docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/xray-core | ||
flavor: latest=true | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- # Add support for more platforms with QEMU (optional) | ||
# https://github.com/docker/setup-qemu-action | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: .github/docker/Dockerfile | ||
push: true | ||
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
Oops, something went wrong.