Certificate error in docker - docker

I'm behind a corporate firewall and have installed Docker on an Ubuntu 14.04 LTS server. Following instructions at http://docs.docker.com/linux/step_one/.
Things seemed to be OK:-
$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:12:04 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:12:04 UTC 2015
OS/Arch: linux/amd64
... but I can't pull and run any images. Example:-
$ docker run hello-world
gives:
Error while pulling image: Get
https://index.docker.io/v1/repositories/library/hello-world/images:
x509: certificate is valid for FG3K6C3A15800002, not index.docker.io
Have spent ages searching around - I don't understand what the issue is - I've set http_proxy and https_proxy env vars but not sure what to try next. The docs don't mention any certificate requirements.
Any help appreciated!

The problem may be the proxy. If you are using a proxy to access the internet, you have to change the file /etc/default/docker and put your proxy on it.
export http_proxy="http://proxy_ip:proxy_port"
export https_proxy="http://proxy_ip:proxy_port"
After do it, restart the service:
sudo service docker restart
It works to me.

Hey Pravins I have the same issue, with my docker 1.11.2 It seems is not taken proxy settings from /etc/default/docker and from env neighter.
So what I did was what it says here
http://docs.master.dockerproject.org/engine/admin/systemd/#http-proxy
Many Linux distributions use systemd to start the Docker daemon.
You need check if the docker.service uses an EnvironmentFile, and/or You can customize the Docker daemon options using override files as explained in the HTTP Proxy example below.

Related

Kubernetes installation on fedora meets a package conflict

When I follow the kubernetes guide to install kubernetes on my local machine which runs fedora 27. I have already installed docker-ce 17.12(followed the Docker CE documentation).
bellow is the install output. is there any body can figure out what should I do to make kubernetes installed but also keep my docker-ce?
[ian#thinkpad ~]$ sudo LANG=en_US.UTF-8 dnf install kubernetes
Last metadata expiration check: 7:31:34 ago on Sat 13 Jan 2018 12:51:44 PM CST.
Error:
Problem: package kubernetes-node-1.7.3-1.fc27.x86_64 requires docker, but none of the providers can be installed
- package docker-ce-17.12.0.ce-1.fc27.x86_64 conflicts with docker provided by docker-2:1.13.1-42.git4402c09.fc27.x86_64
- package docker-ce-17.12.0.ce-1.fc27.x86_64 conflicts with docker provided by docker-2:1.13.1-26.gitb5e3294.fc27.x86_64
- problem with installed package docker-ce-17.12.0.ce-1.fc27.x86_64
- package kubernetes-1.7.3-1.fc27.x86_64 requires kubernetes-node = 1.7.3-1.fc27, but none of the providers can be installed
- conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
[ian#thinkpad ~]$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:17 2017
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:14:50 2017
OS/Arch: linux/amd64
Experimental: false
[ian#thinkpad ~]$
Just requested for push of f27 update of kubernetes-1.9.1 [1] to the stable repository that allows to install either docker or docker-ce. It should take day or 2 to transit. Meantime you can install the kubernetes-node rpm from the update [1]. Tested that locally. Let me know if it does not work for you.
[1] https://bodhi.fedoraproject.org/updates/FEDORA-2018-d0a64cb26c
Regards
Jan
This is a known issue and an update is pending. Eventually, that will be in the updates set for F27 proper. In the meantime, you can get it from updates-testing, by doing:
sudo dnf --enablerepo=updates-testing install kubernetes
... and if that works for you, please add feedback on the pending update.

Can't get Docker image after windows installation

I just installed docker on my windows 10 server,
Installation went fine but I can't seem to get images from central docker repo.
those are my specs:
c:\>docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: windows/amd64
Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true
This is my test command:
c:\>docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: remote error: tls: access denied.
See 'docker run --help'.
This is what I get when running curl on that repo:
c:\>curl -k https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
I guess that there is something to do with my company DNS/Network,
did anyone encounter this issue on windows?
You need to set your proxy env variables.
[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://username:password#proxy:port/", [EnvironmentVariableTarget]::Machine)
Restart-Service docker
Check this for reference: https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon
And more common:
https://docs.docker.com/engine/admin/systemd/#http-proxy
As I replied to #Falco Alexander I got some PowerShell errors, But The proxy was already set in my env. variables.
What finally did the trick was to set the proxy inside the docker GUI:
And then restart the service.

Enable Docker Remote API - raspberry pi / raspbian

My starting point is:
How to use docker remote api to create container?,
so I edit /etc/init/docker.conf and update 2 occurrences of the DOCKER_OPTS variable to:
DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'
Then, a simple test to list docker images fails:
$ service docker restart
$ curl -X GET http://10.143.0.218:4243/images/json
curl: (7) Failed to connect to 10.143.0.218 port 4243: Connection refused
Docker version is:
$ sudo docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
The solution comes from the comments of this page: http://www.virtuallyghetto.com/2014/07/quick-tip-how-to-enable-docker-remote-api.html
[08/18/2016 at 6:00 am] Oliver Weise says:
Thanks, that put me in the right direction. However since Ubuntu 16.04
with its systemd docker daemon the /etc/default/docker is no longer
effective. Instead you need to create a systemd dropin file.
I placed such a file under: /etc/systemd/system/docker.service.d/remote-api.conf
With the contents:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2376 -H unix:///var/run/docker.sock
(Yes, the double ExecStart is necessary)
After that run:
sudo systemctl daemon-reload // reloading daemon definitions
sudo systemctl restart docker
Not tested this, but if it's Jessie, then it uses systemd by default as the init system iirc, and this has implications for how the daemon (dockerd) is configured and started.
So you're editing the /etc/init/docker.conf file but I don't think that's being read / used.
Take a read of this article on different startup procedures on each init system in Docker, and this for specific systemd configuration.

Docker Compose (docker-compose) couldn't connect to docker daemon on Windows Server 2016 TP5

I am trying to get docker-compose to work on Windows Server 2016 TP5. I have installed Docker Desktop for Windows (not Docker Toolbox) as a service, which works perfectly. I have downloaded the latest docker-compose for windows from https://dl.bintray.com/docker-compose/master/ and put it in the same path as Docker (after unblocking the downloaded file, and renaming it to docker-compose.exe.
When I run the docker-compose up (in Powershell as an Administrator), I get the following error:
ERROR: Couldn't connect to Docker daemon. You might need to install
Docker:
https://docs.docker.com/engine/installation/
Here are the docker and docker-compose information on my machine:
Docker:
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: windows/amd64
Docker Compose:
docker-compose version 1.9.0dev, build f65f89a
You might want to try to set your DOCKER_HOST:
$ENV:DOCKER_HOST="npipe://\\.\pipe\docker_engine"
Alternatively, when registering the engine, you can make it listen on TCP too:
dockerd.exe -H npipe:////./pipe/docker_engine -H localhost:2375 --register-service
There are more details on this Compose issue

How to override the default value of COMPOSE_HTTP_TIMEOUT with docker-compose command

I have docker-compose which fetches some of the images and builds one.
When I run docker-compose up , I am getting the following error
ERROR: An HTTP request took too long to complete. Retry with --verbose
to obtain debug information. If you encounter this issue regularly
because of slow network conditions, consider setting
COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
Question: How to pass the COMPOSE_HTTP_TIMEOUT with docker-compose command?
COMPOSE_HTTP_TIMEOUT is an environment variable, so
COMPOSE_HTTP_TIMEOUT=200 docker-compose up
You need your COMPOSE_HTTP_TIMEOUT at your docker instance level (docker-compose up) and not inside your docker image. So the solution is to create a .env file and put this inside:
#.env
COMPOSE_HTTP_TIMEOUT=200
you can check the doc here
For Mac users, restarting docker from the status bar icon fixed this issue:
restart the docker
command: sudo service docker restart
then try docker-compose up
I faced this issue recently. Even after overriding the default COMPOSE_HTTP_TIMEOUT value it did not work for me.
Possible cause As mentioned in documentation Compose CLI environment variables
COMPOSE_HTTP_TIMEOUT: Configures the time (in seconds) a request to the Docker daemon is allowed to hang before Compose considers it failed. Defaults to 60 seconds.
Removing the tty:true from my docker-compose worked for me.
More details on the issueCompose error "HTTP request took too long to complete" #3633
Docker Environment details:
$ docker-compose version
docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.6.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
$ docker version
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:01 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:06:30 2019
OS/Arch: linux/amd64
Experimental: false
Add this one in .env file: COMPOSE_HTTP_TIMEOUT=1000
I had faced similar issue as below:
Quick Solution is, to restart your VM
sudo su - root
reboot -f
Then login again after 5-10 mins and check. It should work now!
Open terminal and type following command
COMPOSE_HTTP_TIMEOUT=200
To verify type
echo $COMPOSE_HTTP_TIMEOUT
Output: 200

Resources