Docker swarm manager pending status - windows

I have 2 windows 2016 server with container services enabled. I have installed docker in both the machines.
Now I am trying to install docker cluster swarm mode. But when run:
docker swarm init --advertise-addr 192.168.233.131 > test.txt
it is stuck and does not display any output.
When I run docker info, it showing
Swarm: pending ( manager node).
Kindly help me to resolve. What have I missed?
Containers: 6 Running: 0 Paused: 0 Stopped: 6 Images: 5 Server
Version: 17.03.0-ee-1 Storage Driver: windowsfilter Windows: Logging
Driver: json-file Plugins: Volume: local Network: l2bridge l2tunnel
nat null overlay transparent Swarm: pending NodeID: l0cavlw31jzh4xbg34gqkubah Is Manager: true ClusterID:
bi188mb7kcd0ct87c1ia1xha3 Managers: 1 Nodes: 1 Orchestration:
Task History Retention Limit: 5 Raft: Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0 Heartbeat Tick: 1 Election
Tick: 3 Dispatcher: Heartbeat Period: 5 seconds CA Configuration:
Expiry Duration: 3 months Node Address: 192.168.233.131 Manager
Addresses:
0.0.0.0:2377 Default Isolation: process Kernel Version: 10.0 14393 (14393.1480.amd64fre.rs1_release.170706-2004) Operating System:
Windows Server 2016 Standard OSType: windows Architecture: x86_64
CPUs: 1 Total Memory: 1.999 GiB Name: WIN-NGCG1EF8Q2E ID:
EAT6:KLZD:BQAY:TXGV:4LR4:POTH:3VSJ:OEQO:TBAN:L322:QFNC:4V3J Docker
Root Dir: C:\ProgramData\docker Debug Mode (client): false Debug Mode
(server): false Registry: https://index.docker.io/v1/ Experimental:
false Insecure Registries:
127.0.0.0/8 Live Restore Enabled: false

C:\> docker swarm init --advertise-addr=HOSTIPADDRESS --listen-addr HOSTIPADDRESS:2377
i have typed the above command format it works thanks #Tarun Lalwani

Related

Docker build crashes whole machine when transferring build context

My machine crashes when I try to build an docker image. I can only build once and then the machine crashes when I try to start a second build.
It always starts and then starts to transfer to the build context, and around the 150-170mb mark it locks up the machine needing a restart to get it back.
I have not been able to find any logs regarding to any errors so I am completely in the dark.
I am running Ubuntu 22.04.1 LTS
In the codeblock below you can find the system specifications
docker info output:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.10.2)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 13
Running: 0
Paused: 0
Stopped: 13
Images: 189
Server Version: 20.10.18
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.0-47-generic
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 12 (Added by Author: Model Intel Core i5-11400H)
Total Memory: 15.36GiB
Name: SHENZHOU
ID: RA4Z:367M:Z7EV:ODMX:IT5C:ZARV:NAAO:KZHX:D3VN:544G:UWA7:U27Q
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Docker service container, error : Service 'w3svc' has been stopped

I'm trying to create multiple containers using "Docker swarm" on Windows Server 2016 my service has been created and replicated but it's not stable it's running with an error.
PS C:\Users\tmman\Desktop\stackdeploy> docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
xw6kqqu7o4ad demo_db replicated 1/1 microsoft/mssql-server-windows-express:latest
kkrpxwiytax9 demo_web replicated 1/1 microsoft/iis:latest *:80->80/tcp
PS C:\Users\tmman\Desktop\stackdeploy> docker service ps demo_web demo_db
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
1s4ybqny71sd demo_web.1 microsoft/iis:latest DELEI4127 Running Starting 2 seconds ago
uohf736ux1ne \_ demo_web.1 microsoft/iis:latest DELEI4127 Shutdown Failed 7 seconds ago "task: non-zero exit (21479438…"
owpguwtbpdxc \_ demo_web.1 microsoft/iis:latest DELEI4127 Shutdown Failed 16 seconds ago "starting container failed: co…"
dg54mihkflbx \_ demo_web.1 microsoft/iis:latest DELEI4127 Shutdown Failed 25 seconds ago "task: non-zero exit (21475000…"
7enznbiqjfp5 \_ demo_web.1 microsoft/iis:latest DELEI4127 Shutdown Failed 37 seconds ago "starting container failed: co…"
o541pdex9s3p demo_db.1 microsoft/mssql-server-windows-express:latest DELEI4127 Running Running 11 minutes ago
PS C:\Users\tmman\Desktop\stackdeploy> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
017afe0a6211 microsoft/iis:latest "C:\\ServiceMonitor.e…" 18 seconds ago Up 10 seconds 80/tcp demo_web.1.1s4ybqny71sds3i9h47i59g4s
5889ac4ef8d2 microsoft/iis:latest "C:\\ServiceMonitor.e…" 27 seconds ago Exited (2147943855) 19 seconds ago demo_web.1.uohf736ux1neaz5u0p1d73jx4
dce80549e789 microsoft/iis:latest "C:\\ServiceMonitor.e…" 37 seconds ago Created 80/tcp demo_web.1.owpguwtbpdxc50em7a3rc8m05
92721722311c microsoft/iis:latest "C:\\ServiceMonitor.e…" 48 seconds ago Exited (2147500037) 38 seconds ago demo_web.1.dg54mihkflbxt2j0wd6tv8qlt
166d29256771 microsoft/iis:latest "C:\\ServiceMonitor.e…" 11 minutes ago Created 80/tcp demo_web.1.7enznbiqjfp5hdvjbgvnj1q1v
fbc3deb1930e microsoft/mssql-server-windows-express:latest "powershell -Command…" 11 minutes ago Up 11 minutes demo_db.1.o541pdex9s3pmaaty8xzkezpx
Error:
PS C:\Users\tmman\Desktop\stackdeploy> docker service logs demo_web
demo_web.1.1vwqd9xgvfd3#DELEI4127 |
demo_web.1.1vwqd9xgvfd3#DELEI4127 | Service 'w3svc' has been stopped
demo_web.1.1vwqd9xgvfd3#DELEI4127 |
demo_web.1.8vs509jzpwb9#DELEI4127 |
demo_web.1.8vs509jzpwb9#DELEI4127 | Service 'w3svc' has been stopped
demo_web.1.8vs509jzpwb9#DELEI4127 |
demo_web.1.8vs509jzpwb9#DELEI4127 | Failed to update IIS configuration
demo_web.1.1vwqd9xgvfd3#DELEI4127 | Failed to update IIS configuration
demo_web.1.z7yhqf1wqqiu#DELEI4127 |
demo_web.1.z7yhqf1wqqiu#DELEI4127 | Service 'w3svc' has been stopped
demo_web.1.z7yhqf1wqqiu#DELEI4127 |
demo_web.1.pt4du3jr20nj#DELEI4127 |
demo_web.1.pt4du3jr20nj#DELEI4127 | Service 'w3svc' has been stopped
demo_web.1.pt4du3jr20nj#DELEI4127 |
demo_web.1.z7yhqf1wqqiu#DELEI4127 | Failed to update IIS configuration
demo_web.1.pt4du3jr20nj#DELEI4127 | Failed to update IIS configuration
PS C:\Users\tmman\Desktop\stackdeploy> docker info
Containers: 6
Running: 2
Paused: 0
Stopped: 4
Images: 3
Server Version: 18.09.2
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: active
NodeID: 1oef3sisa3el3q46tz7aj78eu
Is Manager: true
ClusterID: k4l6x9b42bg7bfnf630g3g2h1
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 10.49.2.50
Manager Addresses:
10.49.2.50:2377
Default Isolation: process
Kernel Version: 10.0 14393 (14393.2848.amd64fre.rs1_release.190305-1856)
Operating System: Windows Server 2016 Standard Version 1607 (OS Build 14393.2848)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 7.999GiB
Name: DELEI4127
ID: 5BCA:25XO:U3TH:JYXD:BULV:MWXO:UWYF:APIZ:AVCF:R2QO:6KFL:A5SE
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
my Dockerfile :
FROM microsoft/iis:nanoserver
WORKDIR /inetpub/wwwroot
RUN powershell -Command `
Add-WindowsFeature Web-Server;
Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe" -OutFile "C:\ServiceMonitor.exe"
EXPOSE 80
ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"]
COPY index.html /index.html
my YML.file:
version: "3"
services:
db:
image: microsoft/mssql-server-windows-express
networks:
- cpxnet
deploy:
environment:
- SA_PASSWORD=Abcd1234
- ACCEPT_EULA=Y
web:
image: microsoft/iis:latest
networks:
- cpxnet
deploy:
resources:
limits:
memory: 50M
ports:
- "80:80"
depends_on:
- db
networks:
cpxnet:
I got some solutions from this website: https://github.com/Microsoft/aspnet-docker/issues/64 but didn't help with my error
Thank you in advance for your help!!
Note!!!: i'm a beginner
I faced similar issue n had almost similar dockerfile.
To troubleshoot I changed the entrypoint to continuous ping to local host. So that I could login to container n check the issue with w3svc.
I found strange multiple events in event viewer (need to view in powershell) that w3svc is started successfully. There were no stop event. But I concluded that something wrong with my service.
I further checked n found that app pool is in "OnDemand" state instead of "always running". I set the apppool property to always running in my dockerfile. Post that switched entrypoint to original value "service monitor.exe w3svc" n it made my container stable.
Note - I m not using default iis image where service monitor already set as entrypoint.

Cannot connect to the Docker daemon at unix:///var/run/docker.sock on OSX

I've created a Scala project that creates a testcontainer (via com.dimafeng.testcontainers) with two Docker's containers (singularities/datastore-emulator and bigtruedata/gcloud-pubsub-emulator). The testcontainer is successfully created, when I run the docker ps command this is what I see:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ddc16471205a quay.io/testcontainers/ryuk:0.2.2 "/app" 2 minutes ago Up 2 minutes 0.0.0.0:32771->8080/tcp testcontainers-ryuk-371a41c2-3d23-426f-943d-608a816c96d3
Now, the problem occurs when I try to run the container:
$ docker run -p 4000:80 quay.io/testcontainers/ryuk:0.2.2
2018/12/13 10:59:48 Starting on port 8080...
panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
goroutine 1 [running]:
main.main()
/go/src/github.com/bsideup/moby-ryuk/main.go:31 +0xe2e
And if I go inside the container and run the /app command this is what I get:
$ docker exec -it ddc /bin/sh
/ # /app
2018/12/13 11:40:55 Starting on port 8080...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x64f8d6]
goroutine 9 [running]:
main.main.func1(0xc4200685a0, 0xc4201bd890, 0xc420068600)
/go/src/github.com/bsideup/moby-ryuk/main.go:42 +0x286
created by main.main
/go/src/github.com/bsideup/moby-ryuk/main.go:39 +0x1b5
I've tried literally everything from setting the docker-machine eval default to check all the possible permissions problems. What am I missing?
(I have no access at all to the go files present in the errors)
Here's the information about my docker installation
$ docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:43 2018
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false
And the infos
$ docker info
Containers: 19
Running: 1
Paused: 0
Stopped: 18
Images: 7
Server Version: 18.09.0
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: 5XHJ:QGZD:4I55:WLU6:RLUF:E5XL:XFUL:PMBB:D432:IJFX:EUPG:QEVW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 33
Goroutines: 58
System Time: 2018-12-13T11:34:52.2335167Z
EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Creating hardlinks in docker container takes long the first time

I am creating hard links of all the files in a directory (some 500MB) in a docker container using following command:
cp -al source destination
Interestingly, when I issue the above command the first time (i.e. when there is no hardlink for each file in that directory), it takes quite a long time. This is not the case when I issue the above command again to create hardlinks of same files in other destination. This is also not the case when I do that in my docker host (even if it's the first hardlink that is being created).
My docker container uses overlay2 as the storage driver. Here is my docker info output
Containers: 61
Running: 1
Paused: 0
Stopped: 60
Images: 142
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Authorization: rhel-push-plugin
Swarm: inactive
Runtimes: runc oci
Default Runtime: oci
Init Binary: /usr/libexec/docker/docker-init-current
containerd version: fbadd789ddf86a4be9d6905528b7486c61e52612 (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: fbadd789ddf86a4be9d6905528b7486c61e52612-dirty (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
WARNING: You're not using the default seccomp profile
Profile: /etc/docker/seccomp.json
selinux
Kernel Version: 4.14.13-300.fc27.x86_64
Operating System: Fedora 27 (Workstation Edition)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 3
CPUs: 8
Total Memory: 15.58 GiB
Name: pranavk.local.me
ID: STYG:PZCA:FMHL:FLCU:N7VG:Z463:KYQF:QVHO:KWKP:FHTY:EUBA:QBUK
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Registries: docker.io (secure), registry.fedoraproject.org (secure), registry.access.redhat.com (secure), docker.io (secure)
Edit:
If I remove all the hardlinks and then issue above cp command again, it's fast again. Phew!
I am not sure what's causing this or from where I should start looking from.

Default docker machine on Mac

I'm a bit confused about the default docker machine on Mac.
Currently, my docker-machine ls shows a machine called default but it's not running. And yet I can still run containers without a problem. I believe what happened was I was having problem with the default setup and I rm and created the default machine. But apparently default is NOT the default machine because when I switch to it with eval $(docker-machine env default) I see completely different images and containers.
What is the default docker machine on Mac?
Here is my versions:
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.7.1
Git commit: 6f9534c
Built: Thu Sep 8 10:31:18 2016
OS/Arch: darwin/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: linux/amd64
docker info output:
Containers: 15
Running: 1
Paused: 0
Stopped: 14
Images: 52
Server Version: 1.12.1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 270
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host overlay null bridge
Swarm: active
NodeID: exto91f6u59r77znpa3kj9ufp
Is Manager: true
ClusterID: 5my0ngxiaozvdt6s44icecy4y
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 192.168.65.2
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.953 GiB
Name: moby
ID: 3QHL:JAAF:XUSR:KR5Q:APNG:Z4LN:XSFR:53YC:6VBQ:DZJE:DM6G:MWXY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 38
Goroutines: 128
System Time: 2016-10-23T02:24:34.36197692Z
EventsListeners: 1
Username: yijian
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Probably you upgraded to docker for mac which no longer use docker-machine to emulate a docker environment in Mac.
You can still use docker-machine primarily for manage remote docker engines.
Regards

Resources