docker golang API ContainerList fails with TLS - docker

I have dockerd configured with TLS authentication on CoreOS;
Cli docker images returns me valid list of images:
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest c75bebcdd211 3 weeks ago 1.106 MB
But trying it in "go" code:
export DOCKER_CERT_PATH=~/.docker
images, err := cli.ImageList(context.Background(), types.ImageListOptions{})
returns me empty list
Below is my docker configuration:
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.3
Git commit: d5236f0
Built: Tue May 30 23:15:08 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.3
Git commit: d5236f0
Built: Tue May 30 23:15:08 2017
OS/Arch: linux/amd64

You have a list of images but you haven't created any containers yet, therefore cli.ContainerList() returns empty list
What you are probably looking for is cli.ImageList()
Docs:
https://godoc.org/github.com/docker/engine-api/client#Client.ImageList

Related

How to switch Docker mode(Linux/Windows)? no matching manifest for linux/amd64 in the manifest list entries

I am on Windows 10
Simple image building does not work
docker run -it --rm mcr.microsoft.com/windows/nanoserver:1809
Unable to find image 'mcr.microsoft.com/windows/nanoserver:1809' locally
1809: Pulling from windows/nanoserver
docker: no matching manifest for linux/amd64 in the manifest list entries.
Docker version shows
Client:
Cloud integration: v1.0.20
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:47:53 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:30 2021
OS/Arch: linux/amd64
Experimental: true
My settings
How to fix this problem?
Looks like you're in Windows Container, you need to switch to Linux Container.
Then, wait for docker restart and retry.

Is there a bug in the docker containerwait api when creating a large number of containers?

Is there a bug in the docker containerwait api?The logs show that it stops at the containerwait function, but I found out via docker ps -a that the container has ended and exitcode=0. With 2000+ containers created, there is a 1 in 100 chance that this will happen.When I create a smaller number of containers, this does not happen. Has anyone experienced the same problem?
Can I implement a waitcontainer api myself by polling the container state?Are there any problems with this approach?
docker version:
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-205.git7d71120.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7d71120/1.13.1
Built: Wed Apr 28 13:37:12 2021
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-205.git7d71120.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7d71120/1.13.1
Built: Wed Apr 28 13:37:12 2021
OS/Arch: linux/amd64
Experimental: false
go sdk version: v1.13.1

Docker pulling image is not successful, it stucks

I used docker-compose up to pull the images. I have tried it more than 10 times, but still not yield the successful results. It always freezes at the Downloading process for some particular images (randomly each time).
It's happened like in this image all the time. The output from using docker-compose up commands:
tommiekub#dell3542:~/dev/freelance/sensebook$ docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.11
Git commit: e68fc7a215
Built: Fri Sep 7 11:26:59 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.11
Git commit: e68fc7a215
Built: Fri Sep 7 11:26:11 2018
OS/Arch: linux/amd64
Experimental: false
How to solve this?

EOF error while pulling images from docker

I am getting following error for
docker pull openjdk
Using default tag: latest
Pulling repository docker.io/library/openjdk
Error while pulling image: Get https://index.docker.io/v1/repositories/library/openjdk/images: EOF
I have set HTTP_PROXY and HTTPS_PROXY in /etc/systemd/system/docker.service.d/http-proxy.conf and /etc/systemd/system/docker.service.d/https-proxy.conf respectively.
Still I am not able to pull any images from docker hub.
Following is the docker version output
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:20:01 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:20:01 2017
OS/Arch: linux/amd64
Here is my setting:
etc/systemd/system/docker.service.d
more http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://user:password#proxy.mycompany.com:8080/" "HTTPS_PROXY=http://user:password#proxy.mycompany.com:8080/" "NO_PROXY=localhost,127.0.0.1,.mycompany.com"
Note that HTTP_PROXY like HTTPS_PROXY both are using an http URL for the proxy. And make sure (with NO_PROXY) that any internal URL does not use the proxy.

"docker pull redis" fails on Docker for Windows

I've installed Docker EE for Windows Server 2016 and was able to pull and run the hello-world example.
When I invoke "docker pull redis" , I get:
Using default tag: latest
latest: Pulling from library/redis
no matching manifest for windows/amd64 in the manifest list entries
My docker versions:
Client:
Version: 17.10.0-ee-preview-2
API version: 1.32
Go version: go1.8.3
Git commit: 10e292d
Built: Thu Sep 21 19:58:53 2017
OS/Arch: windows/amd64
Server:
Version: 17.10.0-ee-preview-2
API version: 1.32 (minimum version 1.24)
Go version: go1.8.3
Git commit: 777d4a1
Built: Thu Sep 21 20:08:05 2017
OS/Arch: windows/amd64
Experimental: false
Not sure what I'm doing wrong here.
As the docker info shows, the server is not started in experiemental mode.
You need to start docker server with experiemental mode on windows server. Check linux-containers-on-windows to see how you can do that.

Resources