<commit_before>FROM golang:alpine AS plugins

RUN go install -ldflags="-d -s -w" -trimpath google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
 && go install -ldflags="-d -s -w" -trimpath google.golang.org/protobuf/cmd/protoc-gen-go@latest


FROM alpine:latest

COPY --from=plugins /go/bin /usr/local/bin

RUN apk add --no-cache \
    protobuf-dev \
    protoc<commit_msg>protoc: fetch Google protobuf types from the GitHub releases page instead of the protobuf-dev package. 40.8MB -> 23.6MB<commit_after>FROM golang:alpine AS plugins

RUN go install -ldflags="-d -s -w" -trimpath google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
 && go install -ldflags="-d -s -w" -trimpath google.golang.org/protobuf/cmd/protoc-gen-go@latest


FROM alpine:latest AS types

ENV PROTOC_VERSION=3.18.1

WORKDIR /tmp

ADD https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip .

RUN unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip \
 && find ./include -type d -exec chmod 755 {} \; \
 && find ./include -type f -exec chmod 644 {} \;


FROM alpine:latest

COPY --from=plugins /go/bin      /usr/local/bin
COPY --from=types   /tmp/include /usr/include

RUN apk add --no-cache protoc
{'fraction_non_alphanumeric': 0.1421647819063005, 'fraction_numerical': 0.01938610662358643, 'mean_word_length': 3.472924187725632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5958216', 'n_tokens_mistral': 473, 'n_tokens_neox': 440, 'n_words': 107}