-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (54 loc) · 1.81 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
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
COPY . .
RUN dotnet restore
WORKDIR /app/ProtocApi
RUN dotnet publish -c release -o /out --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
# main protoc dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends --assume-yes \
protobuf-compiler protobuf-compiler-grpc
# swift
RUN apt-get -y install \
build-essential \
clang \
cmake \
git \
icu-devtools \
libcurl4-openssl-dev \
libedit-dev \
libicu-dev \
libncurses5-dev \
libpython3-dev \
libsqlite3-dev \
libxml2-dev \
ninja-build \
pkg-config \
python2 \
python-six \
python2-dev \
python3-six \
python3-distutils \
rsync \
swig \
systemtap-sdt-dev \
tzdata \
unzip \
uuid-dev
RUN apt-get install -y wget
RUN wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list
RUN apt-get update -yq
RUN apt-get install -y dart
RUN dart pub global activate protoc_plugin
ENV PATH "$PATH:/app/protoc/linux64:/usr/lib/swift/linux:/usr/lib/dart/bin:/root/.pub-cache/bin:/usr/share/swift/usr/bin"
WORKDIR /app
COPY --from=build /out ./
WORKDIR /usr/bin
RUN cp *_plugin /app/protoc/linux64/
LABEL service=protoc-api
WORKDIR /app
RUN chmod -R +x /app/protoc/linux64
ENTRYPOINT ["dotnet", "ProtocApi.dll"]