
On Mon, Sep 28, 2020 at 08:22:06PM +0800, Wu Fengguang wrote:
title: that is => there is
or better: GITCACHE_HOST is undefined
On Mon, Sep 28, 2020 at 05:58:54PM +0800, Hu Xuejiao wrote:
When manually ./build in VM, the GITCACHE_HOST variable is not found.
Signed-off-by: Hu XueJiao <huxuejiao1@huawei.com> --- container/crystal-shards/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/crystal-shards/Dockerfile b/container/crystal-shards/Dockerfile index 0c5713c..bdc5b66 100644 --- a/container/crystal-shards/Dockerfile +++ b/container/crystal-shards/Dockerfile @@ -7,7 +7,7 @@ MAINTAINER chief <taxcom@tom.com>
ARG GITCACHE_HOST ARG GITCACHE_PORT -RUN [ -n "$GITCACHE_HOST" ] && echo -e "[url \"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig +RUN [ -z "$GITCACHE_HOST" ] || echo -e "[url \"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig
They are equal logics?
[ -n ...] && [ -z ...] ||
I think the reason may be the follow: Because of the '-e' param, `[ -n ... ] &&`: if $GITCACHE_HOST is none, process will exit 1 `[ -z ... ] ||`: if $GITCACHE_HOST is none, process will keep executing. -------- Thanks Yu Chuan
Thanks, Fengguang