-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (67 loc) · 2.9 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# syntax = docker/dockerfile:1
FROM alpine:3.19
# Install interpreter languages and tools
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache \
libstdc++ \
nodejs \
protobuf-dev \
protoc \
py3-setuptools \
python3 \
ruby \
&& echo "common $(protoc --version)" >> /versions
ARG GLIBC_VERSION=2.33-r0
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \
&& apk add --no-cache --force-overwrite glibc-${GLIBC_VERSION}.apk \
&& rm /etc/apk/keys/sgerrand.rsa.pub glibc-${GLIBC_VERSION}.apk
ENV \
GEM_HOME=/usr/local \
GOPATH=/go \
LD_LIBRARY_PATH=/usr/lib:/lib \
PATH=/go/bin:/node_modules/.bin/:$PATH
COPY go.mod go.sum /go/src/github.com/seqsense/protoc-assets/
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
cd /go/src/github.com/seqsense/protoc-assets/ \
&& apk add --no-cache --virtual .builddeps \
go \
&& go install google.golang.org/protobuf/cmd/protoc-gen-go \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc \
&& go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
&& go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
&& mkdir -p /protos/grpc-gateway \
&& cp -r /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@*/protoc-gen-openapiv2 /protos/grpc-gateway/ \
&& echo "go $(protoc-gen-go --version)" >> /versions \
&& echo "go $(protoc-gen-go-grpc --version)" >> /versions \
&& echo "go $(protoc-gen-openapiv2 --version)" >> /versions \
&& apk del .builddeps
COPY package.json package-lock.json /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
npm \
&& npm install \
&& echo "node grpc-tools $(npm view grpc-tools version)" >> /versions \
&& apk del .builddeps
COPY requirements.txt /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
py3-pip \
&& python3 -m pip install --break-system-packages -r requirements.txt \
&& python3 -m pip show grpcio_tools \
| sed -n 's/^Version: \(.*\)$/python grpcio_tools \1/p' >> /versions \
&& apk del .builddeps
COPY Gemfile Gemfile.lock /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
ruby-bundler \
&& bundle install \
&& bundle show grpc-tools \
| sed -n 's|^/.*/grpc-tools-\(.*\)$|ruby grpc-tools \1|p'>> /versions \
&& apk del .builddeps
RUN wget https://github.com/googleapis/googleapis/archive/refs/heads/master.tar.gz -O /tmp/googleapis.tar.gz \
&& mkdir -p /protos/googleapis \
&& tar xzfv /tmp/googleapis.tar.gz -C /protos/googleapis --strip-components 1 googleapis-master \
&& rm -rf /tmp/googleapis.tar.gz
WORKDIR /defs