| 1 |
# This Dockerfile builds a base image for the certificate-transparency-go CloudBuild integration testing. |
| 2 |
# See https://hub.docker.com/_/golang for the set of golang base images. |
| 3 |
FROM golang:1.26.0-bookworm@sha256:4465a2fd010308d9de86a610b56ed8ae788da5f0cf2e6ebe33d8e1f275dd2580 AS ct_testbase |
| 4 |
|
| 5 |
WORKDIR /testbase |
| 6 |
|
| 7 |
ARG GOFLAGS="" |
| 8 |
ENV GOFLAGS=$GOFLAGS |
| 9 |
|
| 10 |
RUN apt-get update && apt-get -y install build-essential curl docker-compose lsof mariadb-client netcat-openbsd postgresql-client unzip wget xxd |
| 11 |
|
| 12 |
RUN cd /usr/bin && curl -L -O https://github.com/jqlang/jq/releases/download/jq-1.7/jq-linux64 && mv jq-linux64 /usr/bin/jq && chmod +x /usr/bin/jq |
| 13 |
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 |
| 14 |
RUN mkdir protoc && \ |
| 15 |
(cd protoc && \ |
| 16 |
PROTOC_VERSION=3.20.1 && \ |
| 17 |
PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-x86_64.zip" && \ |
| 18 |
wget "https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}" && \ |
| 19 |
unzip -o ${PROTOC_ZIP} -d /usr/local bin/protoc && \ |
| 20 |
unzip -o ${PROTOC_ZIP} -d /usr/local 'include/*' \ |
| 21 |
) |
| 22 |
ENV PATH=/usr/local/bin:$PATH |
| 23 |
|
| 24 |
COPY ./integration/test-runner.sh /testbase/ |
| 25 |
|
| 26 |
ENV GOPATH=/go |
| 27 |
ENV PATH=$GOPATH/bin:/testbase/protoc/bin:$PATH |
| 28 |
|
| 29 |
CMD ["/bin/bash", "-exc", "/testbase/test-runner.sh"] |