Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootless #63

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rootless
  • Loading branch information
raidenii committed May 21, 2023
commit 31025affa20beb6fd061dc72b992a819a3ec3830
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM --platform=${TARGETPLATFORM} alpine:latest
LABEL maintainer="V2Fly Community <dev@v2fly.org>"

WORKDIR /root
WORKDIR /tmp
ARG TARGETPLATFORM
ARG TAG
COPY v2ray.sh /root/v2ray.sh
COPY v2ray.sh "${WORKDIR}"/v2ray.sh

RUN set -ex \
&& apk add --no-cache tzdata openssl ca-certificates \
&& apk add --no-cache ca-certificates \
&& mkdir -p /etc/v2ray /usr/local/share/v2ray /var/log/v2ray \
# forward request and error logs to docker log collector
&& ln -sf /dev/stdout /var/log/v2ray/access.log \
&& ln -sf /dev/stderr /var/log/v2ray/error.log \
&& chmod +x /root/v2ray.sh \
&& /root/v2ray.sh "${TARGETPLATFORM}" "${TAG}"
&& chmod +x "${WORKDIR}"/v2ray.sh \
&& "${WORKDIR}"/v2ray.sh "${TARGETPLATFORM}" "${TAG}"

ENTRYPOINT ["/usr/bin/v2ray"]
4 changes: 2 additions & 2 deletions v2ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fi
echo "Download binary file: ${V2RAY_FILE} ${DGST_FILE} completed"

# Check SHA512
V2RAY_ZIP_HASH=$(openssl dgst -sha512 v2ray.zip | sed 's/([^)]*)//g')
V2RAY_ZIP_DGST_HASH=$(cat v2ray.zip.dgst | grep -e 'SHA512' -e 'SHA2-512' | head -n1)
V2RAY_ZIP_HASH=$(sha512sum v2ray.zip | cut -f1 -d' ')
V2RAY_ZIP_DGST_HASH=$(cat v2ray.zip.dgst | grep -e 'SHA512' -e 'SHA2-512' | head -n1 | cut -f2 -d' ')

if [ "${V2RAY_ZIP_HASH}" = "${V2RAY_ZIP_DGST_HASH}" ]; then
echo " Check passed" && rm -fv v2ray.zip.dgst
Expand Down
Loading