Docker Community Forums

Share and learn in the Docker community.

Issue in pulling the ubuntu image


(Ramakumar) #1

Hi

I have installed Docker tool box 1.8.1b and able to run some of the Docker commands from VM console with out any issue. But when I execute this command docker pull ubuntu I am getting this error.

Using default tag: latest
Pulling repository docker.io/library/ubuntu
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/ubuntu/images . You may want to check your internet connection or if you are behind a proxy
But the URL (showing in the above error) was accessed from the IE or Google Chrome browser then it is prompting to save/open the file.

Similarly why this is not working when URL is being fetched from the command prompt? Do I need to do configuration changes to resolve this issue?

Thanks,
Ramakumar.B


(Ralph Kincade) #2

what is the IP on the docker instance ? type “ifconfig” and list the result
here.

from the docker instance “ping 8.8.8.8” do you get a reply yes/no ???


(Ramakumar) #3

Thanks Brikeyes for your response.

Below is the response for your questions

  1. what is the IP on the docker instance ? type “ifconfig” and list the result here.

C:>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : ad.dstsystems.com
Link-local IPv6 Address . . . . . : fe80::d5b:1fb4:5415:8d87%11
IPv4 Address. . . . . . . . . . . : 10.161.226.232
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.161.226.1

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::840:c8e6:7515:62db%14
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network #2:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a95f:1df6:2ec0:dc8b%15
IPv4 Address. . . . . . . . . . . : 192.168.99.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Tunnel adapter isatap.ad.dstsystems.com:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : ad.dstsystems.com

Tunnel adapter isatap.{ED8915ED-5A71-4CDA-A9C4-4FB62E88E3B9}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Tunnel adapter isatap.{37588078-8688-48CC-A47D-C97235E62E6F}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

2) From the docker instance “ping 8.8.8.8” do you get a reply yes/no ?

C:>docker info
Containers: 0
Images: 0
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 0
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.0.9-boot2docker
Operating System: Boot2Docker 1.8.1 (TCL 6.3); master : 7f12e95 - Thu Aug 13 03:
24:56 UTC 2015
CPUs: 1
Total Memory: 1.956 GiB
Name: default
ID: TWUP:EO6D:CDXT:H5WZ:UTAM:BCYL:XRFU:GQTM:FRXM:HLX4:XUIP:B6E2
Debug mode (server): true
File Descriptors: 10
Goroutines: 16
System Time: 2015-09-14T06:10:45.270171904Z
EventsListeners: 0
Init SHA1:
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
provider=virtualbox

C:>ping 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

I have not receive any “Yes/No” response from the execution of above command. Only observing “Request timed out”.

I have executed above commands from command prompt window. Not from Default VM console.


(Ranjandas) #4

Hi,

The result you gave here is not exactly what @brikeyes asked for. He asked the output of ifconfig from the Docker Instance and not ipconfig from the Windows Command Prompt.

The second requirement was to test the ping to 8.8.8.8 that too from Docker Instance and not from Windows Command Prompt.

Are you trying this from a personal laptop/desktop or from any company’s internal network?

If you are trying form any company’s internal network there are chances that you are connecting to internet using a Proxy. Fetching docker images through proxy requires a configuration change.

Can you do an nslookup google.com from your windows command prompt. If this is giving you proper output, then try a telnet google.com 80.

Please share the result of above commands so that we will get an idea whether you are connecting directly or through a proxy.

Regards


(Ramakumar) #5

Thank you very much Ranjan for your quick reply and guidance.

Yes, I am trying from my company desktop. Not from laptop.
What configuration changes I need to do for the proxy to fetch Docker images?

Below is the response for nslookup google.com from my windows command prompt.

C:\Users\dt76564>nslookup google.com
Server: dshdaddc1qc.ad.dstsystems.com
Address: 10.161.138.11

Non-authoritative answer:
Name: google.com
Addresses: 2404:6800:4003:c00::8b
74.125.200.101
74.125.200.102
74.125.200.113
74.125.200.138
74.125.200.139
74.125.200.100

Regards
Ramakumar


(Ranjandas) #6

Great, this helps me to understand that you are able to get name resolution working properly. Also from your response I conclude that you have a proxy in your environment.

Now, to make the Docker Daemon to fetch docker images through a Proxy server you should change the docker server configurations. From your first post its clear that you are using Docker toolbox. Now to make changes to the docker daemon, you should get into the boot2docker vm which comes with docker toolbox.

Once you are inside the VM open the file /var/lib/boot2docker/profile using vim and add your proxy details.

docker@boot2docker:~$ sudo vi /var/lib/boot2docker/profile

and add

export HTTP_PROXY=http://your.proxy.name:8080
export HTTPS_PROXY=http://your.proxy.name:8080

Make sure to use the correct proxy address and replace 8080 with your proxies port number.

Then restart docker daemon

docker@boot2docker:~$ sudo /etc/init.d/docker restart

After this try to pull the image and it should work.

The above steps works fine if you have a proxy without authentication. Please let me know if this works or not.

Regards


(Ramakumar) #7

Thanks for quick response Ranjan.

I am not sure how to get into the boot2docker vm ? Currently I am in Default VM and I didn’t create any new container as of now.

I am sorry, may be I am asking very basic question.

In Oracle VM VirtualBox manager, I have started the “Default” VM by clicking the “Start” arrow. When I click the Start arrow, its opening up a new command prompt window and at the end it is giving a message saying “Finished boot2docker init script” and giving me a command prompt root@default:~#
to execute the Docker commands like Docker info, Docker help etc. I have to use this command prompt only to get into boot2docker vm? Please confirm.

Thank you.


(Ranjandas) #8

Yes, you can make the changes I mentioned from that command prompt. Do you know whether your proxy requires authentication. I highly reccomend you to discuss with your organizations IT department regarding the proxy if you are unsure.

Regards


(Ramakumar) #9

Ranjan,

Sure, I will check with my network team for proxy information.

In above post you posted that, use this command to modify the file

docker@boot2docker:~$ sudo vi /var/lib/boot2docker/profile

But in my command prompt I have this prompt root@default:~#

So how can I move from root@default:~# to docker@boot2docker:~$ ??

Please suggest.


(Ranjandas) #10

Hi,

sudo vi /var/lib/boot2docker/profile

This is the command. Dont consider the prompt. I think you should get help from some Linux guy around you.

Regards


(Ramakumar) #11

Hi Ranjan,

Thanks for your valuable guidance in resolving this issue.

As you suggested in your above posts, I have edited the file at this location and added export for both HHTP and HHTPS proxies.

Now I need to restart Docker daemon.

when I execute this command to restart the Docker daemon then I am getting this message,
"Need TLS certs for default, 127.0.0.1, 10.0.2.15, 192.168.99.100

What exactly I need to do to resolve this issue as well. Please suggest.

Regards,
Ramakumar


(Ranjandas) #12

Hi,

Just try to pull a docker image and check whether its working.

eg: docker pull busybox

Its always better to reboot the vm once to make sure that the docker deamon has restarted properly.

Once again, I haven’t used docker-toolbox, so I am giving you inputs based on my boot2docker experience.

Please let me know how it goes.

Regards


(Ramakumar) #13

Ranjan,

When I run this command I am getting this Error pulling the image.

docker pull busybox

Error details: Proxy authentication required.

So this error shows that proxy details provided in /var/lib/boot2docker/profile is being effective.

Let me know syntax details to provide authentication information in /var/lib/boot2docker/profile file.

Thanks for your support.


(Ranjandas) #14

Awesome,

Now to configure authentication you can just modify the http_proxy variable with the username and password pair.

export HTTP_PROXY=http://username:password@your.proxy.name:8080
export HTTPS_PROXY=http://username:password@your.proxy.name:8080

Please try this and let me know the result.

Regards


(Ramakumar) #15

Ranjan,

Good news. Now with authentication details, I could able to pull the bysybox image using the command

docker pull busybox

At the end it is showing the message as: Downloaded newer image for busybox:latest

Thank you very much Ranjan for your valuable support and time in resolving this issue.


(Ranjandas) #16

Wow, thats really a good news.

Have a smooth sail with Docker forward.

Regards