From c55b0fb33a923162d9ebd95ee5654a374b888cfb Mon Sep 17 00:00:00 2001 From: Teddysun Date: Mon, 3 Jan 2022 15:11:58 +0900 Subject: [PATCH] Update Dockerfile --- docker/v2ray/Dockerfile | 2 +- docker/v2ray/Dockerfile.architecture | 2 +- docker/v2ray/build_v2ray.sh | 15 +++++++++------ docker/v2ray/v2ray.sh | 18 +++++++++--------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/docker/v2ray/Dockerfile b/docker/v2ray/Dockerfile index c603bb1..7af4e2b 100644 --- a/docker/v2ray/Dockerfile +++ b/docker/v2ray/Dockerfile @@ -23,4 +23,4 @@ RUN set -ex \ VOLUME /etc/v2ray ENV TZ=Asia/Shanghai -CMD [ "/usr/bin/v2ray", "-config", "/etc/v2ray/config.json" ] +CMD [ "/usr/bin/v2ray", "run", "-config", "/etc/v2ray/config.json" ] diff --git a/docker/v2ray/Dockerfile.architecture b/docker/v2ray/Dockerfile.architecture index ac5dc05..f06cafe 100644 --- a/docker/v2ray/Dockerfile.architecture +++ b/docker/v2ray/Dockerfile.architecture @@ -24,4 +24,4 @@ RUN set -ex \ VOLUME /etc/v2ray ENV TZ=Asia/Shanghai -CMD [ "/usr/bin/v2ray", "-config", "/etc/v2ray/config.json" ] +CMD [ "/usr/bin/v2ray", "run", "-config", "/etc/v2ray/config.json" ] diff --git a/docker/v2ray/build_v2ray.sh b/docker/v2ray/build_v2ray.sh index d9b8073..50cddce 100644 --- a/docker/v2ray/build_v2ray.sh +++ b/docker/v2ray/build_v2ray.sh @@ -4,7 +4,7 @@ # # Supported architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x # -# Copyright (C) 2020 - 2021 Teddysun +# Copyright (C) 2020 - 2022 Teddysun # # Reference URL: # https://github.com/v2fly/v2ray-core.git @@ -29,17 +29,20 @@ ARMS=( 6 7 ) for ARCH in ${ARCHS[@]}; do if [ "${ARCH}" = "arm" ]; then for V in ${ARMS[@]}; do - echo "Building v2ray_linux_${ARCH}${V} and v2ctl_linux_${ARCH}${V}" + # echo "Building v2ray_linux_${ARCH}${V} and v2ctl_linux_${ARCH}${V}" + echo "Building v2ray_linux_${ARCH}${V}" env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GOARM=${V} go build -v -trimpath -ldflags "${LDFLAGS}" -o ${cur_dir}/v2ray_linux_${ARCH}${V} ./main - env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GOARM=${V} go build -v -trimpath -ldflags "${LDFLAGS}" -tags confonly -o ${cur_dir}/v2ctl_linux_${ARCH}${V} ./infra/control/main + # env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GOARM=${V} go build -v -trimpath -ldflags "${LDFLAGS}" -tags confonly -o ${cur_dir}/v2ctl_linux_${ARCH}${V} ./infra/control/main done else - echo "Building v2ray_linux_${ARCH} and v2ctl_linux_${ARCH}" + # echo "Building v2ray_linux_${ARCH} and v2ctl_linux_${ARCH}" + echo "Building v2ray_linux_${ARCH}" env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -trimpath -ldflags "${LDFLAGS}" -o ${cur_dir}/v2ray_linux_${ARCH} ./main - env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -trimpath -ldflags "${LDFLAGS}" -tags confonly -o ${cur_dir}/v2ctl_linux_${ARCH} ./infra/control/main + # env CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -trimpath -ldflags "${LDFLAGS}" -tags confonly -o ${cur_dir}/v2ctl_linux_${ARCH} ./infra/control/main fi done -chmod +x ${cur_dir}/v2ray_linux_* ${cur_dir}/v2ctl_linux_* +# chmod +x ${cur_dir}/v2ray_linux_* ${cur_dir}/v2ctl_linux_* +chmod +x ${cur_dir}/v2ray_linux_* # clean up cd ${cur_dir} && rm -fr v2ray-core diff --git a/docker/v2ray/v2ray.sh b/docker/v2ray/v2ray.sh index 598c168..dec31e0 100644 --- a/docker/v2ray/v2ray.sh +++ b/docker/v2ray/v2ray.sh @@ -2,7 +2,7 @@ # # This is a Shell script for v2ray based alpine with Docker image # -# Copyright (C) 2019 - 2020 Teddysun +# Copyright (C) 2019 - 2022 Teddysun # # Reference URL: # https://github.com/v2fly/v2ray-core.git @@ -41,7 +41,7 @@ fi [ -z "${ARCH}" ] && echo "Error: Not supported OS Architecture" && exit 1 # Download binary file V2RAY_FILE="v2ray_linux_${ARCH}" -V2CTL_FILE="v2ctl_linux_${ARCH}" +# V2CTL_FILE="v2ctl_linux_${ARCH}" echo "Downloading binary file: ${V2RAY_FILE}" wget -O /usr/bin/v2ray https://dl.lamp.sh/files/${V2RAY_FILE} > /dev/null 2>&1 @@ -50,11 +50,11 @@ if [ $? -ne 0 ]; then fi echo "Download binary file: ${V2RAY_FILE} completed" -echo "Downloading binary file: ${V2CTL_FILE}" -wget -O /usr/bin/v2ctl https://dl.lamp.sh/files/${V2CTL_FILE} > /dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Error: Failed to download binary file: ${V2CTL_FILE}" && exit 1 -fi -echo "Download binary file: ${V2CTL_FILE} completed" +# echo "Downloading binary file: ${V2CTL_FILE}" +# wget -O /usr/bin/v2ctl https://dl.lamp.sh/files/${V2CTL_FILE} > /dev/null 2>&1 +# if [ $? -ne 0 ]; then + # echo "Error: Failed to download binary file: ${V2CTL_FILE}" && exit 1 +# fi +# echo "Download binary file: ${V2CTL_FILE} completed" chmod +x /usr/bin/v2ray -chmod +x /usr/bin/v2ctl +# chmod +x /usr/bin/v2ctl