Skip to content

Commit 28301f2

Browse files
tooryxcopybara-github
authored andcommitted
Update the callback server docker to also generate the Python proto definition.
PiperOrigin-RevId: 787169459 Change-Id: I197bfe8fce53149a5eea003362ad99d39ce5fd1c
1 parent 1f9a509 commit 28301f2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,26 @@
33
FROM ghcr.io/google/tsunami-scanner-devel:latest AS build
44

55
# Compile the callback server
6-
76
WORKDIR /usr/repos/tsunami-security-scanner-callback-server
87
COPY . .
98
RUN gradle shadowJar
10-
RUN mkdir /usr/tsunami
9+
RUN mkdir -p /usr/tsunami
1110
RUN find . -name 'tcs-main-*.jar' -exec cp {} /usr/tsunami/tsunami-tcs.jar \; \
1211
&& cp tcs_config.yaml /usr/tsunami/tcs_config.yaml
1312

13+
# Compile proto definitions for Python plugins
14+
RUN mkdir -p /usr/tsunami/py_server
15+
RUN python3 -m grpc_tools.protoc \
16+
-I/usr/repos/tsunami-security-scanner-callback-server/proto \
17+
--python_out=/usr/tsunami/py_server/ \
18+
--grpc_python_out=/usr/tsunami/py_server/ \
19+
/usr/repos/tsunami-security-scanner-callback-server/proto/*.proto
20+
1421
## Stage 2: Release
1522

1623
FROM scratch AS release
1724

1825
# Copy previous build results
1926
COPY --from=build /usr/tsunami/tsunami-tcs.jar /usr/tsunami/
2027
COPY --from=build /usr/tsunami/tcs_config.yaml /usr/tsunami/
28+
COPY --from=build /usr/tsunami/py_server/ /usr/tsunami/py_server

0 commit comments

Comments
 (0)