Optimize `prereqs` Dockerfile to checkout Git submodules first

Due to Docker build cache, this can usually save me 20s+ build time on my MacbookPro each time i
rebuild after a local code change.
This commit is contained in:
Eryu Xia 2021-08-06 02:22:49 -07:00 committed by Stanley Cheung
parent fb3f864a0d
commit da552fc7ee
1 changed files with 4 additions and 3 deletions

View File

@ -22,18 +22,19 @@ RUN echo "\nloglevel=error\n" >> $HOME/.npmrc
WORKDIR /github/grpc-web
# Check out scripts and initialize git submodules first to take advantage of docker build cache.
COPY ./scripts ./scripts
RUN ./scripts/init_submodules.sh
COPY ./Makefile ./Makefile
COPY ./WORKSPACE ./WORKSPACE
COPY ./bazel ./bazel
COPY ./javascript ./javascript
COPY ./net ./net
COPY ./packages ./packages
COPY ./scripts ./scripts
COPY ./src ./src
COPY ./test ./test
RUN ./scripts/init_submodules.sh
RUN cd ./packages/grpc-web && \
npm install && \
npm run build && \