Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Clean up after apt-get (take 2) #23

Merged
merged 1 commit into from
Mar 3, 2017
Merged

Clean up after apt-get (take 2) #23

merged 1 commit into from
Mar 3, 2017

Conversation

rvernica
Copy link
Contributor

Install dependencies and shiny in one Docker command. This allows for cleaning after apt-get (rm -rf /var/lib/apt/lists/*) but not before gdebi which requires the apt cache. See #22 (comment)

This is an improvement over #22 which created problems. It should fix #19.

Install dependencies and shiny in one Docker command. This allow for cleaning after apt-get (`rm -rf /var/lib/apt/lists/*`) but not before `gdebi` which requires the apt cache. See #22 (comment)
@rvernica rvernica mentioned this pull request Feb 11, 2017
@rvernica
Copy link
Contributor Author

rvernica commented Mar 2, 2017

@wch this patch seems pretty stable

@wch
Copy link
Contributor

wch commented Mar 3, 2017

I'm not a fan of running this much stuff in one step, but if it reduces the problems people run into, I guess it's OK.

Can you explain why apt-get update results in the error in the first place? It's not clear to me.

@cboettig
Copy link
Member

cboettig commented Mar 3, 2017

@wch see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run
which shows an example much like this.

I think people are currently getting bitten by the way docker handles caching of layers. You have two run commands, only the first of which runs apt-get update. I think the problem comes if in building the image, docker loads that layer from cache instead of re-running it, which can cause the apt info to get out of date. Since the second run command call to gdebi needs apt-get sources, you run into trouble.

You'll see the example shown in that Dockerfile best practices link makes all the same suggestions as @rvernica : using a single layer, always using apt-get update before apt-get install, and removing the apt/list at the end (just to save space, though downstream users should always be running apt-get update anyway first so there's no point in keeping this). Hope that makes sense?

@wch wch merged commit 24e51cb into rocker-org:master Mar 3, 2017
@rvernica rvernica deleted the patch-1 branch March 3, 2017 21:26
@wch
Copy link
Contributor

wch commented Mar 3, 2017

@cboettig Thanks for the explanation. I'm still not sure why it was erroring on apt-get update though -- that's what it looks like, at least, from the comments on #19.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apt-get update' returned a non-zero code: 100
3 participants