diff --git a/contrib/docker/Dockerfile.ubase-base b/contrib/docker/Dockerfile.ubase-base index 66cbc4b60..0f227a873 100755 --- a/contrib/docker/Dockerfile.ubase-base +++ b/contrib/docker/Dockerfile.ubase-base @@ -1,7 +1,8 @@ FROM ubuntu AS ubase ARG BRANCH=master -ENV BRANCH=BRANCH -ENV TZ=America/Los_Angeles +ENV BRANCH=$BRANCH +ARG TIMEZONE=America/Los_Angeles +ENV TZ=$TIMEZONE RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && apt-get install -yqq \ git \ diff --git a/contrib/docker/build.sh b/contrib/docker/build.sh index 6247afe62..21edac6ba 100755 --- a/contrib/docker/build.sh +++ b/contrib/docker/build.sh @@ -8,7 +8,7 @@ Alist="\n " usage="Usage: \n -\t option mode: \t \`build.sh -o \` \n +\t option mode: \t \`build.sh -o \` \n \t interactive: \t \`build.sh -i\` \n \t \t \t help: \t \`build.sh -h\` \n \n Architectures: ${Alist} \n @@ -19,7 +19,7 @@ h2=" \t \t Enter your Docker Hub Account name." h3=" \t \t \t Enter \"github\" or \"gitlab\"." h4=" \t Enter the git account name. (eg. \"CoinBlack\" on GitHub, or \"blackcoin\" on GitLab)" h5=" \t \t \t Enter the BRANCH name. (eg. master)" -h6=" \t \t Enter your timezone. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)" +h6=" \t \t Enter your timezone. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)" help=" \n \t The defaults in interactive mode, written in for option mode: \n @@ -55,11 +55,11 @@ if [[ $1 == -i ]]; then read -p "Github or Gitlab? ($defaultHubLab): " HubLab read -p "What is your GitAccount name? ($defaultRepo): " GitAccount read -p "What BRANCH/version? ($defaultBranch): " BRANCH - read -p "What is your timezone? (${defaultTimezone}): " timezone + read -p "What is your TIMEZONE? (${defaultTimezone}): " TIMEZONE echo "Architecture: ${architecture}" echo "DockerHub Account: ${DockerHub}" echo "Git Account: ${HubLab}.com/${GitAccount} ${BRANCH}" - echo "Timezone: ${timezone}" + echo "Timezone: ${TIMEZONE}" else echo "Option Mode!" echo "Architecture: $2" @@ -146,11 +146,11 @@ else BRANCH=${BRANCH:-${defaultBranch}} [[ ${BRANCH} != ${defaultBranch} ]] && sed -i "s|ENV BRANCH=v2.13.2.7|ENV BRANCH=${BRANCH}|" ${BASE_DIR}/Dockerfile.ubase && sed -i "s|v2.13.2.7|${BRANCH}|" $0 - # timezone + # TIMEZONE - timezone=${timezone:-${defaultTimezone}} - [[ ${timezone} != ${defaultTimezone} ]] && sed -i "s|America/Los_Angeles|${timezone}|" ${BASE_DIR}/Dockerfile.ubase && \ - sed -i "s|America/Los_Angeles|${timezone}|" ${BASE_DIR}/Dockerfile.ubuntu && sed -i "s|America/Los_Angeles|${timezone}|" $0 + TIMEZONE=${TIMEZONE:-${defaultTimezone}} + [[ ${TIMEZONE} != ${defaultTimezone} ]] && sed -i "s|America/Los_Angeles|${TIMEZONE}|" ${BASE_DIR}/Dockerfile.ubase && \ + sed -i "s|America/Los_Angeles|${TIMEZONE}|" ${BASE_DIR}/Dockerfile.ubuntu && sed -i "s|America/Los_Angeles|${TIMEZONE}|" $0 # build ubase-base