Reputation: 109
I am having virtual box 5.2 on top of Windows 7. I followed docker quick start guide to install docker.docker for windows
Since my machine is behind corporate proxy , i set
HTTP_PROXY=http://xxx:port
HTTPS_PROXY=https://xxx:port
NO_PROXT="192.168.99.1/24"
By passing it while creating docker machine and also did export after machine is up.
'docker-machine create -d virtualbox --engine-env HTTP_PROXY="http://xxx:80" --engine-env HTTPS_PROXY="https://xxx:80" --engine-env NO_PROXY="192.168.99.1/24" default
docker run hello-world
shows above error.
Upvotes: 2
Views: 9473
Reputation: 11
Hello everyone, sorry for my English, but from so much research I finally got to work the problem of the Docker in CentOS 7 to run the Hello-World
Create a directory in systemd for the docker service:
$ mkdir -p /etc/systemd/system/docker.service.d
Create the file with the name https-proxy.conf
$ /etc/systemd/system/docker.service.d/https-proxy.conf
Add the environment variable "HTTP_PROXY" and "HTTPS_PROXY":
[Service]
Environment="HTTP_PROXY=http://(host_name):(port_number)/" "HTTPS_PROXY=http://(host_name):(port_number)/"
Restart service Daemon and Docker "
systemctl daemon-reload
systemctl restart docker
Now, execute the command, Done.
docker run hello-world
Upvotes: 1
Reputation: 366
first check your internet connection is running and then
if you are in docker desktop
simply change the second proxy which is https proxy from https://proxy:port to
http://proxy:port
if you are on linux change the config file to this{ "proxies": { "default": { "httpProxy": "http://127.0.0.1:3001", "httpsProxy": "http://127.0.0.1:3001", "noProxy": "*.test.example.com,.example2.com" } } }
or change the variable to HTTPS_PROXY ENV HTTPS_PROXY="http://proxy:port"
for more info on linux ***
<a href="https://docs.docker.com/network/proxy/"></a>
Upvotes: 0
Reputation: 109
Just change your HTTPS_PROXY=https://xxx:port
to HTTPS_PROXY=http://xxx:port
.
Futher more, if you use the configuration file in directory /etc/systemd/system/docker.service.d
, then need to change the content existed in https-proxy.conf
file. after that, run below command to make it effective:
systemctl daemon-reload
systemctl restart docker.service
Then your problem should be solved. :)
Upvotes: 7
Reputation: 109
This is what worked out for me. Once installed docker as per instructions given docker quick start and create docker machine replace boot2docker.iso at C:\Users\anant.docker\machine\machines\default with the same present at C:\Program Files\Docker Toolbox
restart docker
docker-machine restart
apply environment variable
docker-machine env
output :
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="C:\Users\anant.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"
@# Run this command to configure your shell: @# eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
then to test, try
docker run hello-world
Upvotes: 1