瀏覽代碼

build: install go based on env variable

bergquist 8 年之前
父節點
當前提交
eeb2e2c6c9
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      scripts/build/Dockerfile

+ 5 - 3
scripts/build/Dockerfile

@@ -21,12 +21,14 @@ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380
 RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \
 RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \
     yum install -y nodejs --nogpgcheck
     yum install -y nodejs --nogpgcheck
 
 
+ENV GOLANG_VERSION 1.9.1
+
 RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && \
 RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && \
     yum install -y yarn --nogpgcheck && \
     yum install -y yarn --nogpgcheck && \
-    wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz && \
-    tar -C /usr/local -xzf go1.9.1.linux-amd64.tar.gz
+    wget https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
+    tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz
+
 
 
-ENV GOLANG_VERSION 1.9.1
 ENV PATH /usr/local/go/bin:$PATH
 ENV PATH /usr/local/go/bin:$PATH
 
 
 RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
 RUN mkdir -p /go/src /go/bin && chmod -R 777 /go