snapcraft cleanbuild proxy support

Stéphane Graber stgraber at ubuntu.com
Wed Feb 1 15:32:29 UTC 2017


On Wed, Feb 01, 2017 at 11:27:19AM -0200, Andreas Hasenack wrote:
> Hi,
> 
> is there a way to inject the proxy variables into snapcraft buildclean?
> 
> I tried the usual exports (lower case and upper case), but the lxd that
> snapcraft creates doesn't get any of those. I checked /etc/environment and
> /etc/apt/apt.conf.d/*, and I also don't see any hits on my proxy.
> 
> lxd itself has proxy configured:
> $ lxc config show
> config:
>   core.https_address: '[::]'
>   core.proxy_http: http://10.0.100.180:3128/
>   core.proxy_https: http://10.0.100.180:3128/
>   core.proxy_ignore_hosts: localhost,127.0.0.1

Those apply to the LXD daemon itself, as in, for things like downloading
LXD images and the like. They're not propagated to the containers as
they may be on an interely different network from the host.

>   storage.zfs_pool_name: nsn7/lxd
> 
> Thanks!

Does setting the following container keys help (you can set them on the
default profile to have them applied to all containers):

    environment.http_proxy
    environment.https_proxy
    environment.no_proxy

Those will simply make sure that LXD always sets those environment
variables during all "lxc exec" sessions, as well as pass those to the
init process (which unfortunately is likely to discard them).

If that doesn't work, then configuring /etc/environment in the container
is your best bet. There may be a cloud-init way of doing this, which
would be the preferred way of handling all this.


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170201/72d9a53b/attachment.sig>


More information about the Snapcraft mailing list