mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
add abpath to user-package
This commit is contained in:
parent
7313089539
commit
0d99c3f942
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
############################
|
||||||
|
# STEP 1 build executable binary
|
||||||
|
############################
|
||||||
|
FROM golang:alpine AS builder
|
||||||
|
RUN apk update && apk add --no-cache git bash wget
|
||||||
|
WORKDIR /go/src/v2ray.com/core
|
||||||
|
RUN git clone --progress --depth=1 --branch dockerdev https://github.com/v2fly/v2ray-core.git . && \
|
||||||
|
bash -x ./release/user-package.sh nosource noconf abpathtgz=/tmp/v2ray.tgz
|
||||||
|
############################
|
||||||
|
# STEP 2 build a small image
|
||||||
|
############################
|
||||||
|
FROM alpine
|
||||||
|
COPY --from=builder /tmp/v2ray.tgz /tmp
|
||||||
|
RUN apk update && apk add ca-certificates && \
|
||||||
|
mkdir -p /usr/bin/v2ray && \
|
||||||
|
tar xvfz /tmp/v2ray.tgz -C /usr/bin/v2ray
|
||||||
|
ENTRYPOINT ["/usr/bin/v2ray/v2ray"]
|
@ -86,6 +86,14 @@ packtgz() {
|
|||||||
echo ">>> Generated: $(basename $PKG)"
|
echo ">>> Generated: $(basename $PKG)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packtgzAbPath() {
|
||||||
|
local ABPATH="$1"
|
||||||
|
echo ">>> Generating tgz package at $ABPATH"
|
||||||
|
pushd $TMP
|
||||||
|
tar cvfz $ABPATH .
|
||||||
|
echo ">>> Generated: $ABPATH"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pkg=zip
|
pkg=zip
|
||||||
nosource=0
|
nosource=0
|
||||||
@ -127,6 +135,9 @@ case $arg in
|
|||||||
tgz)
|
tgz)
|
||||||
pkg=tgz
|
pkg=tgz
|
||||||
;;
|
;;
|
||||||
|
abpathtgz=*)
|
||||||
|
pkg=${arg##abpathtgz=}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -147,11 +158,12 @@ fi
|
|||||||
|
|
||||||
if [[ $pkg == "zip" ]]; then
|
if [[ $pkg == "zip" ]]; then
|
||||||
packzip
|
packzip
|
||||||
|
elif [[ $pkg == "tgz" ]]; then
|
||||||
|
packtgz
|
||||||
|
else
|
||||||
|
packtgzAbPath $pkg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $pkg == "tgz" ]]; then
|
|
||||||
packtgz
|
|
||||||
fi
|
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user