Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

bebehei
Copy link
Contributor

@bebehei bebehei commented Feb 15, 2019

Takes care of #60

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.
@bebehei bebehei force-pushed the love4dockerfile branch 2 times, most recently from eb72a09 to 51aa7d0 Compare February 22, 2019 15:43
Copy link
Member

@humitos humitos left a 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
Copy link
Member

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?

Copy link
Contributor Author

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 ....

Copy link
Member

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?

Copy link
Contributor Author

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)

Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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.

Dockerfile Show resolved Hide resolved
@humitos
Copy link
Member

humitos commented Apr 28, 2022

Hi! Our Docker file has changed considerably since this PR was opened. We are now maintaining only the branches release/ubuntu-* that are simpler and nicer. Feel free to take a look at them and make any suggestions there. Thanks for your PR!

@humitos humitos closed this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants