Skip to content

Commit

Permalink
rootless (v2fly#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
raidenii committed May 24, 2023
1 parent 8a01b2d commit 4bb372b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 4bb372b

Please sign in to comment.