forked from v2fly/docker
-
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.
- Loading branch information
Showing
5 changed files
with
124 additions
and
81 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,76 @@ | ||
on: | ||
push: | ||
paths: | ||
- "ReleaseTag" | ||
|
||
name: docker push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set env | ||
run: | | ||
echo "TAG=$(cat ReleaseTag | head -n1)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Install Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
|
||
- name: Build Target | ||
run: | | ||
cp ReleaseTag DockerHub | ||
cd DockerHub | ||
chmod +x v2ray.sh | ||
./v2ray.sh | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build latest | ||
run: | | ||
cd DockerHub | ||
docker buildx build --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x \ | ||
--output "type=image,push=true" \ | ||
--tag "${{ secrets.DOCKER_USERNAME }}/v2fly-core:latest" \ | ||
--file Dockerfile.multi . | ||
- name: Build tag | ||
run: | | ||
cd DockerHub | ||
docker buildx build --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x \ | ||
--output "type=image,push=true" \ | ||
--tag "${{ secrets.DOCKER_USERNAME }}/v2fly-core:${{ env.TAG }}" \ | ||
--file Dockerfile.multi . | ||
test: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set env | ||
run: | | ||
echo "TAG=$(cat ReleaseTag | head -n1)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Test Docker image | ||
run: | | ||
docker run --rm --entrypoint /usr/bin/v2ray ${{ secrets.DOCKER_USERNAME }}/v2fly-core:latest -version | ||
docker run --rm --entrypoint /usr/bin/v2ray ${{ secrets.DOCKER_USERNAME }}/v2fly-core:${{ env.TAG }} -version |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
FROM alpine:latest | ||
LABEL maintainer "V2Fly Community <dev@v2fly.org>" | ||
|
||
WORKDIR /root | ||
ARG TARGETVARIANT | ||
ARG TARGETARCH | ||
COPY v2ray-${TARGETARCH}${TARGETVARIANT}.tar.gz /usr/bin/v2ray.tar.gz | ||
COPY geoip.dat /usr/bin/geoip.dat | ||
COPY geosite.dat /usr/bin/geosite.dat | ||
COPY config.json /etc/v2ray/config.json | ||
|
||
RUN set -ex \ | ||
&& apk add --no-cache tzdata ca-certificates \ | ||
&& mkdir -p /etc/v2ray/ /var/log/v2ray \ | ||
&& tar -zxvf /usr/bin/v2ray.tar.gz -C /usr/bin \ | ||
&& rm -fv /usr/bin/v2ray.tar.gz | ||
|
||
VOLUME /etc/v2ray | ||
CMD [ "/usr/bin/v2ray", "-config", "/etc/v2ray/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,28 @@ | ||
#!/bin/bash | ||
|
||
# Get code | ||
CUR=${PWD} | ||
TAG=$(cat ReleaseTag | head -n1) | ||
git clone -b ${TAG} https://github.com/v2fly/v2ray-core.git && cp v2ray-core/release/config/*.dat ${CUR} && cp v2ray-core/release/config/config.json ${CUR} | ||
cd v2ray-core | ||
|
||
# Build release | ||
ARCHS=( 386 amd64 arm arm64 ppc64le s390x ) | ||
ARMS=( 6 7 ) | ||
LDFLAGS="-s -w -buildid=" | ||
|
||
for ARCH in ${ARCHS[@]}; do | ||
if [ "${ARCH}" = "arm" ]; then | ||
for ARM in ${ARMS[@]}; do | ||
echo "Building v2ray-linux-${ARCH}v${ARM}" | ||
env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GOARM=${ARM} go build -o v2ray -trimpath -ldflags "${LDFLAGS}" ./main | ||
env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GOARM=${ARM} go build -o v2ctl -trimpath -ldflags "${LDFLAGS}" -tags confonly ./infra/control/main | ||
chmod +x v2ray v2ctl && tar -zvcf ${CUR}/v2ray-${ARCH}v${ARM}.tar.gz v2ray v2ctl && rm -fv v2ray v2ctl | ||
done | ||
else | ||
echo "Building v2ray-linux-${ARCH}" | ||
env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -o v2ray -trimpath -ldflags "${LDFLAGS}" ./main | ||
env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -o v2ctl -trimpath -ldflags "${LDFLAGS}" -tags confonly ./infra/control/main | ||
chmod +x v2ray v2ctl && tar -zvcf ${CUR}/v2ray-${ARCH}.tar.gz v2ray v2ctl && rm -fv v2ray v2ctl | ||
fi | ||
done |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v4.30.0 | ||
v4.30.0 |