Skip to content

Commit ce169c2

Browse files
committed
Reduce docker image size with extra build step
1 parent aa97aa8 commit ce169c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/grpc-js-xds/interop/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# following command from grpc-node directory:
1717
# docker build -t <TAG> -f packages/grpc-js-xds/interop/Dockerfile .
1818

19-
FROM node:16-alpine
19+
FROM node:16-alpine as build
2020

2121
# Make a grpc-node directory and copy the repo into it.
2222
WORKDIR /node/src/grpc-node
@@ -27,4 +27,9 @@ RUN npm install
2727
WORKDIR /node/src/grpc-node/packages/grpc-js-xds
2828
RUN npm install
2929

30+
FROM node:16-alpine
31+
WORKDIR /node/src/grpc-node
32+
COPY --from=build /node/src/grpc-node/packages/grpc-js ./packages/grpc-js/
33+
COPY --from=build /node/src/grpc-node/packages/grpc-js-xds ./packages/grpc-js-xds/
34+
3035
ENTRYPOINT [ "node", "/node/src/grpc-node/packages/grpc-js-xds/build/interop/xds-interop-client" ]

0 commit comments

Comments
 (0)