Skip to content

Commit be296a9

Browse files
iwishiwasaneagleplatisd
authored andcommitted
Improve docker build times by 28%
From 53s to 38s on my machine (with --no-cache)
1 parent d804d5c commit be296a9

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
FROM python:3.7-slim-buster
1+
FROM python:3.7-slim
22

33
RUN apt-get update
44
RUN apt-get -y install git jq
55

6-
COPY entrypoint.sh /action/entrypoint.sh
7-
COPY run_action.py /action/run_action.py
8-
COPY duplicate_code_detection.py /action/duplicate_code_detection.py
9-
COPY requirements.txt /action/requirements.txt
6+
COPY duplicate_code_detection.py requirements.txt run_action.py entrypoint.sh /action/
107

11-
RUN pip3 install -r /action/requirements.txt
12-
RUN pip3 install requests
13-
RUN python3 -c "import nltk; nltk.download('punkt')"
14-
# nltk_data ends up in /root so python can't find it
15-
RUN ln -s /root/nltk_data /usr/local/nltk_data
8+
RUN pip3 install -r /action/requirements.txt requests && \
9+
python3 -c "import nltk; nltk.download('punkt')" && \
10+
ln -s /root/nltk_data /usr/local/nltk_data
1611

1712
ENTRYPOINT ["/action/entrypoint.sh"]

0 commit comments

Comments
 (0)