dart-pub: move PUB_CACHE outside of /root/

This commit is contained in:
Hui Yiqun 2019-02-25 13:12:47 +08:00
parent 6561f66fac
commit 44673378b6
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
FROM google/dart:2.1.1 FROM google/dart:2.1.1
MAINTAINER Hui Yiqun <i@huiyiqun.me> MAINTAINER Hui Yiqun <i@huiyiqun.me>
ENV PUB_CACHE /pub-cache
RUN pub global activate pub_mirror RUN pub global activate pub_mirror
CMD /bin/bash CMD /bin/bash

2
pub.sh
View File

@ -4,4 +4,4 @@ set -e
BASE_URL=${MIRROR_BASE_URL:-"https://mirrors.tuna.tsinghua.edu.cn/dart-pub"} BASE_URL=${MIRROR_BASE_URL:-"https://mirrors.tuna.tsinghua.edu.cn/dart-pub"}
UPSTREAM_URL=${TUNASYNC_UPSTREAM_URL:-"https://pub.dartlang.org/api"} UPSTREAM_URL=${TUNASYNC_UPSTREAM_URL:-"https://pub.dartlang.org/api"}
/root/.pub-cache/bin/pub_mirror --upstream $UPSTREAM_URL --verbose --connections 10 --concurrency 100 "$TUNASYNC_WORKING_DIR" "$BASE_URL" /pub-cache/bin/pub_mirror --upstream $UPSTREAM_URL --verbose --connections 10 --concurrency 100 "$TUNASYNC_WORKING_DIR" "$BASE_URL"