This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): docker build fails when apt archive is stale
`apt-get update` before the first apt command seems to fix this in general.
- Loading branch information
d9b8578
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.
Should just move line 8 to before line 5/6.
d9b8578
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.
But we have to do it twice I think: once up front, to make sure we can actually fetch python-software-properties. Which we have to have installed in order to do
apt-add-repository
. Then once we've added the new apt-get sources we need toapt-get update
again.d9b8578
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.
Hmmm, ok. It probably makes more sense to move the installing of python-software-properties to be after adding the repositories and updating then, to avoid updating twice. But if this fixes the build quickly...
d9b8578
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.
Maybe it's necessary as it is.. I'm not super familiar with python-software-properties.
d9b8578
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.
python-software-properties provides
add-apt-repository
, so there's the chicken-and-egg. (There are other ways to add apt-get repositories, butadd-apt-repository
is so convenient.) But anyapt-get install
in a Dockerfile can fail if it wasn't preceded by anapt-get update
, because otherwise we may get stale data from parent filesystem layers in deis/base (or even ubuntu:12.04). This used to bite everyone in the Docker world until they updated the mirrors that ubuntu:12.04 uses for apt-get, now it's less common.So I think @gabrtv did this correctly except for not prefixing everything with
apt-get update
.d9b8578
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.
Gotcha, thanks for the knowledge. LGTM.
d9b8578
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.
LGTM