Skip to content

Commit bb8c25b

Browse files
committed
Add hook for a custom on-build.sh script during Docker image build
1 parent 28a9a53 commit bb8c25b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ RUN npm install
1515
CMD sh boot.sh
1616

1717
ONBUILD ADD . /app/
18+
ONBUILD RUN if [ -f /app/on-build.sh ]; \
19+
then \
20+
echo "Running custom on-build.sh of child" \
21+
&& chmod +x /app/on-build.sh \
22+
&& /bin/bash /app/on-build.sh ;\
23+
fi
1824
ONBUILD RUN cd /usr/src/app && npm install && if [ -f "/app/package.json" ]; then npm install /app; fi

0 commit comments

Comments
 (0)