mirror of https://github.com/v2ray/v2ray-core
add abpath to user-package
parent
1486ac6aa5
commit
89637f68e7
|
@ -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 @@ packtgzAbPath() {
|
||||||
echo ">>> Generated: $ABPATH"
|
echo ">>> Generated: $ABPATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
@ -130,12 +138,6 @@ case $arg in
|
||||||
abpathtgz=*)
|
abpathtgz=*)
|
||||||
pkg=${arg##abpathtgz=}
|
pkg=${arg##abpathtgz=}
|
||||||
;;
|
;;
|
||||||
codename=*)
|
|
||||||
CODENAME=${arg##codename=}
|
|
||||||
;;
|
|
||||||
buildname=*)
|
|
||||||
BUILDNAME=${arg##buildname=}
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -161,7 +163,7 @@ if [[ $pkg == "zip" ]]; then
|
||||||
elif [[ $pkg == "tgz" ]]; then
|
elif [[ $pkg == "tgz" ]]; then
|
||||||
packtgz
|
packtgz
|
||||||
else
|
else
|
||||||
packtgzAbPath "$pkg"
|
packtgzAbPath $pkg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue