Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update and shrink images a bit #5

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

Merged
merged 10 commits into from
Jul 11, 2020
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Mar 20, 2020

This does a variety of things (see commits) to update and shrink the images. This lines up some things with matplotlib/matplotlib#16848.

I got rid of conda because everything is pip-installed anyway, so it's not really helping us. Switching from xenial to bionic would have saved 150M more, but instead I went with the official python image as base, due to the reason listed in its docs of better layer sharing. The pre-installed packages also cut out on extra install steps for us.

Using the fonts-humor-sans package adds 12 M for some reason, but dropping libgeos-dev saves 3M. Bigger savings come from dropping caches for 84M and switching base images for 628M. Overall, the image is 75% of its original size. Most of the remaining size is probably from LaTeX, and I don't think Debian has any finer-granularity packages for that (maybe Fedora would help there, but I don't want to change the container that much arbitrarily.)

QuLogic and others added 10 commits March 18, 2020 18:55
It's available on all releases we'd use.
Even using the full container, and not the minimal one, has some
immediate benefit on image size. Plus, as noted in the python image's
docs, it can help save space due to common layers.
Also, de-verbose it because it outputs a ton of extra information.
@tacaswell
Copy link
Member

podman build --tag matplotlib:dev -f ./Dockerfile 
cd ../matplotlib
podman run -ti -v ./:/mpl_source matplotlib:dev bash -c "pip install /mpl_source && make -C/mpl_source/doc html"
podman run -ti -v ./:/mpl_source matplotlib:dev bash -c "pip install -e /mpl_source && cd /mpl_source && pytest -n4"   

is how I am using it.

@tacaswell
Copy link
Member

I'm going to go ahead and merge this.

@tacaswell tacaswell merged commit 6c5f541 into matplotlib:master Jul 11, 2020
@matthewfeickert
Copy link
Contributor

podman build --tag matplotlib:dev -f ./Dockerfile 
cd ../matplotlib
podman run -ti -v ./:/mpl_source matplotlib:dev bash -c "pip install /mpl_source && make -C/mpl_source/doc html"
podman run -ti -v ./:/mpl_source matplotlib:dev bash -c "pip install -e /mpl_source && cd /mpl_source && pytest -n4"   

is how I am using it.

Okay, so one idea here that might work that I explore a bit in PR #8 is to use the following pattern

docker run --rm -it -v $PWD:/mpl_source -w /mpl_source matplotlib/mpl-docker:<image tag>

this is basically the same as what you have except that it also explicitly sets the working directory to be /mpl_source which should allow for you to just then do

docker run --rm -it -v $PWD:/mpl_source -w /mpl_source matplotlib/mpl-docker:dev /bin/bash -c "pip install ."

in the example you gave.

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