File tree Expand file tree Collapse file tree 2 files changed +42
-16
lines changed Expand file tree Collapse file tree 2 files changed +42
-16
lines changed Original file line number Diff line number Diff line change 11FROM ekidd/rust-musl-builder
22
3+ # ENV HTTP_PROXY="http://192.168.0.104:8118"
4+ # ENV HTTPS_PROXY="http://192.168.0.104:8118"
5+
6+ ENV SODIUM_VERS="1.0.15"
7+
38# Build a static copy of libsodium.
4- RUN VERS=1.0.15 && \
5- cd /home/rust/libs && \
6- curl -LO https://download.libsodium.org/libsodium/releases/libsodium-$VERS.tar.gz && \
7- tar xzf libsodium-$VERS.tar.gz && cd libsodium-$VERS && \
9+ RUN cd /home/rust/libs && \
10+ curl -LO https://download.libsodium.org/libsodium/releases/libsodium-$SODIUM_VERS.tar.gz && \
11+ tar xzf libsodium-$SODIUM_VERS.tar.gz && cd libsodium-$SODIUM_VERS && \
812 CC=musl-gcc ./configure --prefix=/usr/local/musl && \
913 make && sudo make install && \
10- cd .. && rm -rf libsodium-$VERS.tar.gz libsodium-$VERS
14+ cd .. && rm -rf libsodium-$SODIUM_VERS.tar.gz libsodium-$SODIUM_VERS
15+
16+ # RUN rustup install nightly
17+ # RUN rustup default nightly
18+ # RUN rustup target add x86_64-unknown-linux-musl
1119
1220ENV SODIUM_STATIC=yes
1321ENV SODIUM_LIB_DIR=/usr/local/musl/lib
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ VERSION=" latest"
4+ ENABLE_GZ=false
5+
6+ while getopts " v:gh" opt; do
7+ case $opt in
8+ v)
9+ VERSION=$OPTARG
10+ ;;
11+ g)
12+ ENABLE_GZ=true
13+ ;;
14+ h|\? )
15+ echo " $0 [-v VERSION] [-g] [-h]"
16+ exit 0
17+ ;;
18+ esac
19+ done
20+
321IMAGE=' shadowsocks-rust:latest'
422CUR_DIR=$( cd $( dirname $0 ) && pwd )
523
@@ -9,6 +27,8 @@ SRC_PATH="/home/rust/src"
927CARGO_TARGET_DIR=" ${SRC_PATH} /build/target"
1028LOCAL_USER=$( id -u " $USER " ) :$( id -g " $USER " )
1129
30+ TARGET_NAME=" x86_64-unknown-linux-musl"
31+
1232docker run \
1333 -e CARGO_TARGET_DIR=" ${CARGO_TARGET_DIR} " \
1434 -v " ${CUR_DIR} " /..:" $SRC_PATH " \
@@ -17,25 +37,23 @@ docker run \
1737 /bin/bash -c \
1838 " sudo mkdir -p $CARGO_TARGET_DIR \
1939 && sudo chown -R rust:rust $CARGO_TARGET_DIR \
20- && cargo build --release \
40+ && cargo build --release --target $TARGET_NAME \
2141 && sudo chown -R $LOCAL_USER $CARGO_TARGET_DIR "
2242
23- TARGET_NAME= " x86_64-unknown-linux-musl "
43+
2444TARGET_DIR=" $CUR_DIR /target/$TARGET_NAME /release/"
2545cd " $TARGET_DIR "
2646
27- VERSION=$1
28- if [[ -z " $VERSION " ]]; then
29- VERSION=" latest"
30- fi
31-
3247# # Disable OS X ACL file
3348export COPYFILE_DISABLE=1
3449
35- tar -czf " ${CUR_DIR} /shadowsocks-${VERSION} -release.${TARGET_NAME} .tar.gz" \
36- " sslocal" \
37- " ssserver" \
38- " ssurl"
50+ if $ENABLE_GZ ; then
51+ tar -czf " ${CUR_DIR} /shadowsocks-${VERSION} -release.${TARGET_NAME} .tar.gz" \
52+ " sslocal" \
53+ " ssserver" \
54+ " ssurl"
55+ fi
56+
3957tar -cJf " ${CUR_DIR} /shadowsocks-${VERSION} -release.${TARGET_NAME} .tar.xz" \
4058 " sslocal" \
4159 " ssserver" \
You can’t perform that action at this time.
0 commit comments