Browse Source

Dockerfile-test: use ubuntu 16.10 as base image

Debian base image from golang-stretch was breaking
shellcheck tests.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 years ago
parent
commit
cd4ca4065e
1 changed files with 37 additions and 12 deletions
  1. 37 12
      Dockerfile-test

+ 37 - 12
Dockerfile-test

@@ -1,18 +1,48 @@
-FROM golang:1.9.1-stretch
+FROM ubuntu:16.10
 
-RUN apt-get -y update
-RUN apt-get -y install \
+RUN rm /bin/sh && ln -s /bin/bash /bin/sh
+RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
+
+RUN apt-get -y update \
+  && apt-get -y install \
+  build-essential \
+  gcc \
+  apt-utils \
+  pkg-config \
+  software-properties-common \
+  apt-transport-https \
+  libssl-dev \
+  sudo \
+  bash \
+  curl \
+  wget \
+  tar \
+  git \
   netcat \
   libaspell-dev \
   libhunspell-dev \
   hunspell-en-us \
   aspell-en \
-  shellcheck
+  shellcheck \
+  && apt-get -y update \
+  && apt-get -y upgrade \
+  && apt-get -y autoremove \
+  && apt-get -y autoclean
+
+ENV GOROOT /usr/local/go
+ENV GOPATH /go
+ENV PATH ${GOPATH}/bin:${GOROOT}/bin:${PATH}
+ENV GO_VERSION 1.9.1
+ENV GO_DOWNLOAD_URL https://storage.googleapis.com/golang
+RUN rm -rf ${GOROOT} \
+  && curl -s ${GO_DOWNLOAD_URL}/go${GO_VERSION}.linux-amd64.tar.gz | tar -v -C /usr/local/ -xz \
+  && mkdir -p ${GOPATH}/src ${GOPATH}/bin \
+  && go version
 
 RUN mkdir -p ${GOPATH}/src/github.com/coreos/etcd
 WORKDIR ${GOPATH}/src/github.com/coreos/etcd
 
-ADD ./scripts/install-marker.sh ./scripts/install-marker.sh
+ADD ./scripts/install-marker.sh /tmp/install-marker.sh
 
 RUN go get -v -u -tags spell github.com/chzchzchz/goword \
   && go get -v -u github.com/coreos/license-bill-of-materials \
@@ -21,12 +51,7 @@ RUN go get -v -u -tags spell github.com/chzchzchz/goword \
   && go get -v -u honnef.co/go/tools/cmd/staticcheck \
   && go get -v -u github.com/wadey/gocovmerge \
   && go get -v -u github.com/gordonklaus/ineffassign \
-  && ./scripts/install-marker.sh amd64 \
+  && /tmp/install-marker.sh amd64 \
+  && rm -f /tmp/install-marker.sh \
   && curl -s https://codecov.io/bash >/codecov \
   && chmod 700 /codecov
-
-# e.g.
-# docker build --tag etcd-test --file ./Dockerfile-test .
-# docker run --volume=`pwd`:/go/src/github.com/coreos/etcd etcd-test \
-#  /bin/sh -c "INTEGRATION=y PASSES='build integration_e2e' ./test"
-