Docker Multi Host (Swarm) Persistence Storage - docker

I am running Docker in swarm mode with below version
Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:41:23 2017
OS/Arch: linux/amd64
Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:42:49 2017
OS/Arch: linux/amd64
Experimental: false
To achieve Persistence storage in native container or host based we can mount host drive, But if the host is down data will be lost because its not shared.
Another option can be using NFS setup and mounting volume in container, But this will lead another problem of Slowness and if NFS Server is down everything is down.
Do we have any other Highly Available,Secure solution to setup persistence storage with Multi Host sharing.

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

Remove Docker limit-cpu, limit-memory, reserve cpu and memory

I am currently using a Docker Swarm with limit-cpu, limit-memory and reserve cpu and memory.
After done my testing I would like to remove these configurations. I couldn't find any article for how to remove these.
Is there anyway to remove these setting by update without delete and recreate the docker service?
Docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a215d7133c34aa18e3b72b4a21fd0c6136
Built: Tue Oct 2 18:06:45 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.10.3
Git commit: e68fc7a/18.06.1-ce
Built: Tue Oct 2 18:08:26 2018
OS/Arch: linux/amd64
Experimental: false
Please help.
Thanks
You can use docker service update full documentation can be found here -> https://docs.docker.com/engine/reference/commandline/service_update/
To update or remove the cpu and memory limits you could run this command
docker service update --limit-cpu 0 --limit-memory 0 --reserve-cpu 0 --reserve-memory 0 service_name

unable to find the /etc/default/docker with latest docker 17.03.0-ce

I have installed latest docker version 17.03.0-ce in centos 7 and please find the docker version details below,
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Experimental: false
I need to do an multi-host networking using swarm and i was following this link Lab 06: Docker Networking
They have mentioned to edit /etc/default/docker file to comment out DOCKER_OPTS value. But i couldnt see any file in my host machine. Where could i find this file to change the value of DOCKER_OPTS
The guide is for debian based systems that use /etc/default in Redhat based systems use:
/etc/sysconfig
in your case:
/etc/sysconfig/docker
You can edit the systemd unit file directly for your purpose, but its not recommended.

File not getting updated when using "docker cp"

I am trying to use docker cp to copy .class files from my host into the container. I am using the following command:
docker cp foo.class container:/path/foo.class
I am doing this when the server running inside the container is shutdown.
However, I am seeing that the foo.class isn't getting updated with my latest file and if I try to rm the file I get a
rm: cannot remove foo.class: Stale file handle
Here is my docker version (Docker for Mac):
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: darwin/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
Anyone seen this happen?
TIA

Resources