Dockerfile: Update for gb

This commit is contained in:
Alexander Neumann 2016-02-20 17:00:12 +01:00
parent 9bda164ed3
commit 6e31f4bb19
1 changed files with 15 additions and 15 deletions

View File

@ -4,18 +4,21 @@
# build the image: # build the image:
# docker build -t restic/test . # docker build -t restic/test .
# #
# run tests: # run all tests and cross-compile restic:
# docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go run run_integration_tests.go # docker run --rm -v $PWD:/home/travis/restic restic/test go run run_integration_tests.go -minio minio
# #
# run interactively with: # run interactively:
# docker run --interactive --tty --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test /bin/bash # docker run --interactive --tty --rm -v $PWD:/home/travis/restic restic/test /bin/bash
# #
# run a tests: # run a subset of tests:
# docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go test -v ./backend # docker run --rm -v $PWD:/home/travis/restic restic/test gb test -v ./backend
#
# build the image for an older version of Go:
# docker build --build-arg GOVERSION=1.3.3 -t restic/test:go1.3.3 .
FROM ubuntu:14.04 FROM ubuntu:14.04
ARG GOVERSION=1.5.3 ARG GOVERSION=1.6
ARG GOARCH=amd64 ARG GOARCH=amd64
# install dependencies # install dependencies
@ -34,15 +37,13 @@ WORKDIR $HOME
RUN wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GOVERSION}.linux-${GOARCH}.tar.gz RUN wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GOVERSION}.linux-${GOARCH}.tar.gz
RUN tar xf /tmp/go.tar.gz && rm -f /tmp/go.tar.gz RUN tar xf /tmp/go.tar.gz && rm -f /tmp/go.tar.gz
ENV GOROOT $HOME/go ENV GOROOT $HOME/go
ENV PATH $PATH:$GOROOT/bin
ENV GOPATH $HOME/gopath ENV GOPATH $HOME/gopath
ENV PATH $PATH:$GOPATH/bin ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin:$HOME/bin
RUN mkdir -p $GOPATH/src/github.com/restic/restic RUN mkdir -p $HOME/restic
# pre-install tools, this speeds up running the tests itself # pre-install tools, this speeds up running the tests itself
RUN go get github.com/tools/godep RUN go get github.com/constabulary/gb/...
RUN go get golang.org/x/tools/cmd/cover RUN go get golang.org/x/tools/cmd/cover
RUN go get github.com/mattn/goveralls RUN go get github.com/mattn/goveralls
RUN go get github.com/mitchellh/gox RUN go get github.com/mitchellh/gox
@ -52,7 +53,6 @@ RUN mkdir $HOME/bin \
&& chmod +x $HOME/bin/minio && chmod +x $HOME/bin/minio
# set TRAVIS_BUILD_DIR for integration script # set TRAVIS_BUILD_DIR for integration script
ENV TRAVIS_BUILD_DIR $GOPATH/src/github.com/restic/restic ENV TRAVIS_BUILD_DIR $HOME/restic
ENV GOPATH $GOPATH:${TRAVIS_BUILD_DIR}/Godeps/_workspace
WORKDIR $TRAVIS_BUILD_DIR WORKDIR $HOME/restic