How to make docker cli use dockerhub v2 registry url - docker

When I try to push an image like
docker push jikuma/dockercomposetest
it is resolved as
docker.io/jikuma/dockercomposetest repository url.
I want to use v2 docker hub registry url. How can I do that. What should be my registry url. And how to make it default for docker client?
Here is docer version output.
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:30:30 2017
OS/Arch: windows/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:51:55 2017
OS/Arch: linux/amd64
Experimental: true

Related

Why can I start a process in a container that ''docker ps'' says has exited?

I have a docker container on AWS EC2 instance :
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b78279ed9e51 gnumeric "sleep infinity" 2 months ago Exited (137) 4 weeks ago gnumeric
$ docker exec gnumeric ps -ef
UID PID PPID C STIME TTY TIME CMD
1000 1 0 0 Jan15 ? 00:00:00 sleep infinity
1000 4861 0 0 21:31 ? 00:00:00 ps -ef
$ uname -a
Linux ip-10-0-2-199.ec2.internal 5.10.149-133.644.amzn2.x86_64 #1 SMP Tue Oct 18 16:52:42 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ docker version
Client:
Version: 20.10.17
API version: 1.41
Go version: go1.18.6
Git commit: 100c701
Built: Wed Sep 28 23:10:17 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.18.6
Git commit: a89b842
Built: Wed Sep 28 23:10:55 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.3
GitCommit: 1e7bb5b773162b57333d57f612fd72e3f8612d94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Why can I run commands on a container with Exited status ?
Update
$ docker version # Windows
Client:
Cloud integration: v1.0.29
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:36:18 2022
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.16.1 (95567)
Engine:
Version: 20.10.22
API version: 1.41 (minimum version 1.12)
Go version: go1.18.9
Git commit: 42c8b31
Built: Thu Dec 15 22:26:14 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.14
GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Error response from daemon: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead

I try to build a simple docker file and I get the error.
Error response from daemon: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead
What's wrong?
The build command I use is as follows.
docker build -f .\DockerFile -t helloworld:dev .
The docker file is very simple and looks as follows.
FROM buildpack-deps:curl AS download-env
RUN wget https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json
The docker version command gives the following output.
Client: Docker Engine - Community
Cloud integration 0.1.18
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:00:27 2020
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 20.10.0-beta1
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 9c15e82
Built: Tue Oct 13 18:14:39 2020
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.4.1
GitCommit: c623d1b36f09f8ef6536a057bd658b3aa8632828
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
And the /etc/docker/daemon.json file is as follows
{
"hosts": [
"unix://",
"tcp://0.0.0.0:2375"
],
"experimental": true,
"debug": true,
"metrics-addr": "0.0.0.0:9323"
}
Looks like this is an issue with the Docker Community Edition (i.e. Docker for Desktop). Here's the commit that fixes it: https://github.com/docker/docker-ce/commit/95971a49f97defa51b166211fbd6d44080540a62
In the mean time, you can do one of the following:
Downgrade your Docker CE server version (to 19.x.y, I believe), or
upgrade your Docker CLI version (to 20.x.y, I believe), or
run Docker commands with DOCKER_BUILDKIT=1, or
add the following to your /etc/docker/daemon.json file:
"features": { "buildkit": true }
Once a patch is released, you can upgrade your Docker CE server version and run Docker as before.
I was using this test script as instructed here.
Then I replaced the test script with the get script here.
Now the engine version is 19.03.13 instead of 20.10.0-beta1.
D:\Trials\Devops\Vagrant\vagrant_ubuntu_docker_multiple>docker version
Client: Docker Engine - Community
Cloud integration 0.1.18
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:00:27 2020
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:01:06 2020
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

Why docker run `--oom-kill-disable` is not effective , but `echo 1 > memory.oom_control` is effective in myself System!

When I run one container for docker run --oom-kill-disable, it is not effective; But when I "echo 1 > memory.oom_control", it is effective.
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:05:38 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:12:29 2017
OS/Arch: linux/amd64
Experimental: false
1.sudo docker run -it --memory=100M --oom-kill-disable MyselfImage /bin/bash
2.stress --vm 1 --vm-bytes 200M #stress process is killed
stress: info: [42] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
stress: FAIL: [42] (415) <-- worker 43 got signal 9
stress: WARN: [42] (417) now reaping child worker processes
stress: FAIL: [42] (451) failed run completed in 1s
3.echo 1 > /sys/fs/cgroup/memory/docker/XXX/memory.oom_control
4.stress --vm 1 --vm-bytes 200M #stress process is not killed
stress: info: [42] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
...
Why the memory.oom_control file is not changed by --oom-kill-disable param.
When I try docker 19.03.7, it works! so, this question is a bug in my docker(17.12.0-ce)
Client: Docker Engine - Community
Version: 19.03.7
API version: 1.40
Go version: go1.12.17
Git commit: 7141c199a2
Built: Wed Mar 4 01:19:42 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.7
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: 7141c199a2
Built: Wed Mar 4 01:19:50 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

dockerd with userland-proxy set to false

Configured docker daemon with --iptables=true and --userland-proxy=false.
With that no more docker-proxy processes.
But, containers on the host can't talk with each other through the host IP and forwarded port on host.
This seems to be expected. But is there anyway to enable container to container communication through host forwarded ports (without getting into iptables modification each and everytime a new container is brought up).
[root#AppServer ~]# docker version
Client:
Version: 18.03.1-ol
API version: 1.37
Go version: go1.9.4
Git commit: 0d51d18
Built: Wed Aug 22 21:59:42 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ol
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0d51d18
Built: Wed Aug 22 22:03:05 2018
OS/Arch: linux/amd64
Experimental: false
[root#AppServer ~]#

nodeRegistration.criSocket: Invalid value: "/var/run/dockershim.sock": path is not absolute

I'm trying to join (WINDOWS Server 2016) nodes(workers) to (RHEL 7.5) master through kubeadm.
I'm making it following below tutorials:
https://kubernetes.io/docs/setup/independent/install-kubeadm/
https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
https://learn.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/getting-started-kubernetes-windows
As network connection I use Flannel:
https://github.com/Microsoft/SDN/tree/master/Kubernetes/flannel/l2bridge
My master node works as is expected - kubectl get pods --all-namespaces all pods are running. During performing following command on WS2016:
kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>
I have the error:
nodeRegistration.criSocket: Invalid value: "/var/run/dockershim.sock": path is not absolute
The path "/var/run/dockershim.sock" is default in the kubeadm config.
Also on WS2016 I can't do any pull image:
docker run hello-world
Unable to find image 'hello-world:latest' locally
C:\Program Files\Docker\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: up proxy.example.com: no such host.
Useful link:
https://kubernetes.io/docs/getting-started-guides/windows/
Also I tried do do it with Windows Server version 1709 but with the same issue.
Below I write out details:
Master:
kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:14:39Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Client:
Version: 18.06.0-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:08:18 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.0-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:10:42 2018
OS/Arch: linux/amd64
Experimental: false
Worker:
kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350
reeState:"clean", BuildDate:"2018-07-17T18:50:16Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"windows/amd64"}
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d90335045
eState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: proxyconnect tcp: dial tcp: lookup proxy.example.com: no such host
Client:
Version: 17.06.2-ee-16
API version: 1.30
Go version: go1.8.7
Git commit: 9ef4f0a
Built: Thu Jul 26 16:43:19 2018
OS/Arch: windows/amd64
Server:
Engine:
Version: 17.06.2-ee-16
API version: 1.30 (minimum version 1.24)
Go version: go1.8.7
Git commit: 9ef4f0a
Built: Thu Jul 26 16:52:17 2018
OS/Arch: windows/amd64
Experimental: false
EDIT:
I solved problem with docker by creating other VM but still I have:
nodeRegistration.criSocket: Invalid value: "/var/run/dockershim.sock": path is not absolute: /var/run/dockershim.sock
I've found out, that I need change --cri-socket to tcp://localhost:2375 but I don't know how. The following command doesn't work (on WS2016):
kubeadm config upload from-flags --cri-socket=tcp://localhost:2375 --kubeconfig="C:\k\config"
Anybody know how it to change?

Resources