2019-07-09 16:56:08 +01:00
|
|
|
FROM golang:1.12.7
|
2019-04-22 14:45:53 +01:00
|
|
|
|
2019-06-27 17:09:37 +01:00
|
|
|
# Postgres
|
|
|
|
|
2019-04-23 13:28:30 +01:00
|
|
|
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
|
|
|
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
2019-04-22 14:45:53 +01:00
|
|
|
|
2019-04-23 13:28:30 +01:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y -qq postgresql-11 unzip
|
|
|
|
|
|
|
|
RUN rm /etc/postgresql/11/main/pg_hba.conf; \
|
|
|
|
echo 'local all all trust' >> /etc/postgresql/11/main/pg_hba.conf; \
|
|
|
|
echo 'host all all 127.0.0.1/8 trust' >> /etc/postgresql/11/main/pg_hba.conf; \
|
|
|
|
echo 'host all all ::1/128 trust' >> /etc/postgresql/11/main/pg_hba.conf; \
|
|
|
|
echo 'host all all ::0/0 trust' >> /etc/postgresql/11/main/pg_hba.conf;
|
2019-04-22 14:45:53 +01:00
|
|
|
|
2019-04-25 13:31:22 +01:00
|
|
|
RUN echo 'max_connections = 1000' >> /etc/postgresql/11/main/conf.d/connectionlimits.conf
|
|
|
|
|
2019-06-27 17:09:37 +01:00
|
|
|
# Tooling
|
|
|
|
|
2019-04-22 14:45:53 +01:00
|
|
|
COPY ./scripts/install-awscli.sh /tmp/install-awscli.sh
|
|
|
|
RUN bash /tmp/install-awscli.sh
|
|
|
|
ENV PATH "$PATH:/root/bin"
|
|
|
|
|
|
|
|
RUN curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
|
|
|
RUN unzip /tmp/protoc.zip -d "$HOME"/protoc
|
|
|
|
|
2019-06-27 17:09:37 +01:00
|
|
|
# Linters
|
|
|
|
|
2019-06-21 15:57:38 +01:00
|
|
|
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.17.1
|
2019-04-22 14:45:53 +01:00
|
|
|
RUN go get github.com/ckaznocha/protoc-gen-lint
|
|
|
|
RUN go get github.com/nilslice/protolock/cmd/protolock
|
|
|
|
RUN go get github.com/josephspurrier/goversioninfo
|
2019-06-27 17:09:37 +01:00
|
|
|
RUN go get github.com/loov/leakcheck
|
2019-04-22 14:45:53 +01:00
|
|
|
|
2019-06-27 17:09:37 +01:00
|
|
|
# Output formatters
|
|
|
|
|
|
|
|
RUN go get github.com/mfridman/tparse
|
2019-04-26 14:39:11 +01:00
|
|
|
RUN go get github.com/axw/gocov/gocov
|
|
|
|
RUN go get github.com/AlekSi/gocov-xml
|
2019-06-21 15:57:38 +01:00
|
|
|
|
2019-06-27 17:09:37 +01:00
|
|
|
# Set our entrypoint to close after 18 minutes, and forcefully close at 20 minutes.
|
|
|
|
# This is to prevent Jenkins collecting cats.
|
|
|
|
ENTRYPOINT ["timeout", "-k20m", "18m"]
|