-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Docker from local code rather than git #77
Comments
Hi @OllieJC, and thanks for the suggestions. I think the original way I had the Dockerfile and associated files were geared more towards my use case, so they may not have been optimized for quick testing, so thanks for the contributions there. I don't think there would be any issue with the additional copies, but I'd be curious how much that adds size-wise via the additional layers, if at all. Have you compared the size of the |
Thanks to both of you for your thoughts on this. I've used Docker very little, so I'll defer to whatever you think is best and be happy to merge it. |
Good point @weslambert about sizes! You're right with your thinking, the overall image size once built is ~42Mb larger. FROM alpine:3.10
COPY requirements.txt /unfurl/requirements.txt
RUN apk update && apk add --no-cache git python3 && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
pip3 install -r /unfurl/requirements.txt
COPY unfurl/ /unfurl/unfurl/
COPY *.py unfurl.ini /unfurl/
RUN sed -i 's/^host.*/host = 0.0.0.0/' /unfurl/unfurl.ini
WORKDIR /unfurl
ENTRYPOINT ["/usr/bin/python3", "unfurl_app.py"] |
Looks good to me! 👍 Thanks! |
After raising #75 and trying to develop a new parser I realised that the code pulls from GitHub rather than building from local files.
A suggestion would be to use the local files rather than git, for example (as well as use a python base image):
The reason for the two
COPY
s is so that between changes, builds are cached up to the secondCOPY
and then those changes built rather than all the dependencies every time.I figured I'd raise an issue rather than another PR to get some comments. It would be good to get @weslambert thoughts.
The text was updated successfully, but these errors were encountered: