lxc-create doesn't take advantage of the apt proxy

Bug #1081786 reported by Matt Ray
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Wishlist
Serge Hallyn

Bug Description

While using lxc-create to build containers I see it's building the base OS in /var/cache/lxc and re-downloading a whole lot of .debs. I am using apt-cacher-ng, but lxc-create is ignoring the /etc/apt/apt.conf.d/01proxy and going straight out to the Internet, and this makes me sad because I am bandwidth-challenged.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug.

You can work around this by editing /etc/default/lxc and setting

MIRROR="http://10.0.3.1:3142/archive.ubuntu.com/ubuntu"

(That is assuming you are using the default lxcbr0.)

Changed in lxc (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Matt Ray (mattray) wrote :

That's good enough for me, feel free to close the ticket.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I think we could better integrate the host apt proxy data into the template. Ideally the user shouldn't have to make customizations to lxc when the host already knows how to use the proxy. There is a question of whether the host proxy will be valid in the guest (i.e. if using 'http://localhost:3142/', then if we mirror that into the guest then updates will fail in the container although initial container setup will succeed).

I'll leave this open with wishlist priority with the hope we can get better integration.

Changed in lxc (Ubuntu):
importance: Medium → Wishlist
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

So to do this properly, do I understand right that we would simply grep for Acquire::http::Proxy in /etc/apt/apt.conf and /etc/apt/apt.conf.d/*?

Revision history for this message
Simon Déziel (sdeziel) wrote :

Assuming /etc/default/lxc is sourced, how about integrating this directly in it:

  # Is there a local apt-proxy/cacher available ?
  eval $(apt-config shell MIRROR Acquire::http::Proxy)

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1081786] Re: lxc-create doesn't take advantage of the apt proxy

Quoting Simon Déziel (<email address hidden>):
> Assuming /etc/default/lxc is sourced, how about integrating this
> directly in it:
>
> # Is there a local apt-proxy/cacher available ?
> eval $(apt-config shell MIRROR Acquire::http::Proxy)

Thanks, that sounds like a neat trick :)

Changed in lxc (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
status: Triaged → In Progress
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Fix committed in upstream git.

Changed in lxc (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 1.0.0~alpha1-0ubuntu2

---------------
lxc (1.0.0~alpha1-0ubuntu2) saucy; urgency=low

  * Add allow-stderr to autopkgtst restrictions as the Ubuntu template
    uses policy-rc.d to disable some daemons and that causes a message to
    be printed on stderr when the service tries to start.
 -- Stephane Graber <email address hidden> Thu, 12 Sep 2013 13:57:17 -0400

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.