-
Notifications
You must be signed in to change notification settings - Fork 70
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
Give the dockerfile some love (2/x) #94
Conversation
Exporting DEBIAN_FRONTEND via an `ENV` forces every invocation of the docker container to be 'noninteractive'. It's better to force the frontend as an `export` inside the shell every time apt-get is called.
There is no necessity to reduce a single layer's size in a docker image. What matters in a docker image is the overall size and the amount of layers.
Removes all the packages in the list, which are actually transient packages of texlive-full. texlive-full depends on: texlive-fonts-recommended texlive-fonts-extra texlive-lang-english texlive-lang-japanese texlive-latex-extra-doc texlive-pictures-doc texlive-publishers-doc latex-cjk-all latex-cjk-chinese-arphic-bkai00mp latex-cjk-chinese-arphic-gbsn00lp latex-cjk-chinese-arphic-gkai00mp
The users should not change at all. So moving the layer to the bottom is the best choice.
eb72a09
to
51aa7d0
Compare
51aa7d0
to
8b018e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
I left some comments to consider.
@@ -3,28 +3,23 @@ FROM ubuntu:18.04 | |||
LABEL mantainer="Read the Docs <support@readthedocs.com>" | |||
LABEL version="5.0.0rc1" | |||
|
|||
ENV DEBIAN_FRONTEND noninteractive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one is still needed for when you jump into the image and run apt install x
directly, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the reason why it's done via export ...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, running
docker run -it readthedocs/build:latest /bin/bash
I suppose that we still want to run with the noninteractive
, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running it with docker run -i
implies to be interactive, setting DEBIAN_FRONTEND=noninteracive
is contradicting. 😉
See the official answer moby/moby#4032 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know, but I want to have the same behavior when running apt install X
from docker run -i
than when that command is ran from Read the Docs build process internally (a os.system
call at setup.py
for example). Otherwise, it's hard to be sure that what I'm testing locally will work in production.
ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin | ||
RUN curl -L https://github.com/pyenv/pyenv/archive/master.tar.gz \ | ||
| tar xz \ | ||
&& mv pyenv-master .pyenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to keep the absolute path here (~docs/.pyenv
) to avoid potential future problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather use ~/.pyenv
, ok? Specifying the docs user should be redundant.
Hi! Our Docker file has changed considerably since this PR was opened. We are now maintaining only the branches |
Takes care of #60