[lxc-users] Installation JDK in the LXC container - Host behind Proxy

BB eeg5auquaephoo5j at gmail.com
Sun Dec 28 18:06:10 UTC 2014


Hi,

this is really not an LXC specific question but I will try to give you some
hints...

1) Test if you can actually resolve the proxy's name to an IP address from
inside the container
2) Optionally test if you can reach the proxy on the specified port by
using telnet, netcat, or some other "simple" tool
3) You must use export if you are not calling apt-get in the same line:
    export http_proxy=http://proxy:3128
    export https_proxy=https://proxy:3128
4) You probably want to make the proxy setting persistent by adding the
following to /etc/apt/apt.conf.d/00proxy:
    Acquire::http::Proxy "http://yourproxyaddress:proxyport";
5) For more information have a look here if you are using Ubuntu:

https://help.ubuntu.com/community/AptGet/Howto#Setting_up_apt-get_to_use_a_http-proxy

Kind regards,

BB

On Sun, Dec 28, 2014 at 4:44 PM, Thouraya TH <thouraya87 at gmail.com> wrote:

> Hello,
>
> The host on which i work is a remote machine behind a proxy.
> I have installed the jdk like that and it works well: (I access the remote
> machine via ssh)
>
>      http_proxy=http://proxy:3128 && https_proxy=http://proxy:3128
>      sudo apt-get install openjdk-7-jre-headless
>      :~# java
>             Usage: java [-options] class [args...]
>            (to execute a class)
>             or  java [-options] -jar jarfile [args...]
>            (to execute a jar file)
>            where options include:
>            -d32      use a 32-bit data model if available
>            -d64      use a 64-bit data model if available
>            -server      to select the "server" VM
>
> I'd like to install the JDK inside the container. I proceeded as follows:
>
>       ubuntu at worker:~$ http_proxy=http://proxy:3128 &&
>       https_proxy=http://proxy:3128
>       ubuntu at worker:~$ sudo apt-get install openjdk-7-jre-headless
>                        Reading package lists... Done
>                        Building dependency tree
>                        Reading state information... Done
>                        The following extra packages will be installed:
>                        ca-certificates ca-certificates-java
> fontconfig-config fonts-
>                        dejavu-core
>                        java-common libasyncns0 libavahi-client3
> libavahi-common-data
>                        libavahi-common3 libcups2 libflac8 libfontconfig1
> libfreetype6
>                        libglib2.0-0
>                        libglib2.0-data libjpeg-turbo8 libjpeg8 liblcms2-2
> libnspr4
>                        libnss3
>                        libnss3-nssdb libogg0 libpcsclite1 libpulse0
> libsndfile1
>                        libvorbis0a
>                        libvorbisenc2 libxau6 libxcb1 libxdmcp6 libxml2
> openssl sgml-base
>                        shared-mime-info tzdata-java xml-core
>                        ............................
>                       Err http://archive.ubuntu.com/ubuntu/ trusty/main
> java-common all
>                       0.51
>                       Cannot initiate the connection to
> archive.ubuntu.com:80
>                      (2001:67c:13......). - connect (101: Network is
> unreachable)
>                       [IP: 2001:67c:13....... 80]
>
>
>
> Have you an idea please ?
>
> Thanks a lot.
> Best Regards.
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20141228/a607c509/attachment.html>


More information about the lxc-users mailing list