<commit_before># This Dockerfiles configures a container that is similar to the Travis CI
# environment and can be used to run tests locally.
#
# build the image:
#   docker build -t restic/test .
#
# run tests:
#   docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go run run_integration_tests.go
#
# run interactively with:
#   docker run --interactive --tty --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test /bin/bash
#
# run a tests:
#   docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go test -v ./backend

FROM ubuntu:14.04

ARG GOVERSION=1.5.2
ARG GOARCH=amd64

# install dependencies
RUN apt-get update
RUN apt-get install -y --no-install-recommends ca-certificates wget git build-essential

# download and install Go
RUN wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GOVERSION}.linux-${GOARCH}.tar.gz
RUN cd /var/lib && tar xf /tmp/go.tar.gz
RUN rm -f /tmp/go.tar.gz

ENV GOROOT /var/lib/go
ENV PATH $PATH:$GOROOT/bin

# add and configure user
ENV HOME /home/travis
ENV GOPATH $HOME/gopath
ENV PATH $PATH:$GOPATH/bin
RUN useradd -m -d $HOME -s /bin/bash travis

# run everything below as user travis
USER travis
WORKDIR $HOME

# make gopath
RUN mkdir -p $GOPATH/src/github.com/restic/restic

# install tools
RUN go get golang.org/x/tools/cmd/cover
RUN go get github.com/mattn/goveralls
RUN go get github.com/mitchellh/gox
RUN GO15VENDOREXPERIMENT=1 go get github.com/minio/minio

# set TRAVIS_BUILD_DIR for integration script
ENV TRAVIS_BUILD_DIR $GOPATH/src/github.com/restic/restic
ENV GOPATH $GOPATH:${TRAVIS_BUILD_DIR}/Godeps/_workspace

WORKDIR $TRAVIS_BUILD_DIR
<commit_msg>Dockerfile: Install go in home dir<commit_after># This Dockerfiles configures a container that is similar to the Travis CI
# environment and can be used to run tests locally.
#
# build the image:
#   docker build -t restic/test .
#
# run tests:
#   docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go run run_integration_tests.go
#
# run interactively with:
#   docker run --interactive --tty --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test /bin/bash
#
# run a tests:
#   docker run --rm -v $PWD:/home/travis/gopath/src/github.com/restic/restic restic/test go test -v ./backend

FROM ubuntu:14.04

ARG GOVERSION=1.5.2
ARG GOARCH=amd64

# install dependencies
RUN apt-get update
RUN apt-get install -y --no-install-recommends ca-certificates wget git build-essential

# add and configure user
ENV HOME /home/travis
RUN useradd -m -d $HOME -s /bin/bash travis

# run everything below as user travis
USER travis
WORKDIR $HOME

# download and install Go
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
ENV GOROOT $HOME/go
ENV PATH $PATH:$GOROOT/bin

ENV GOPATH $HOME/gopath
ENV PATH $PATH:$GOPATH/bin

RUN mkdir -p $GOPATH/src/github.com/restic/restic

# install tools
RUN go get golang.org/x/tools/cmd/cover
RUN go get github.com/mattn/goveralls
RUN go get github.com/mitchellh/gox
RUN GO15VENDOREXPERIMENT=1 go get github.com/minio/minio

# set TRAVIS_BUILD_DIR for integration script
ENV TRAVIS_BUILD_DIR $GOPATH/src/github.com/restic/restic
ENV GOPATH $GOPATH:${TRAVIS_BUILD_DIR}/Godeps/_workspace

WORKDIR $TRAVIS_BUILD_DIR

{'fraction_non_alphanumeric': 0.11258083480305703, 'fraction_numerical': 0.007054673721340388, 'mean_word_length': 3.889367816091954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6452995', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1260, 'n_words': 360}