Docker login to nexus repository within docker stack under Docker Desktop for Windows

I have a docker stack which contains jenkins master, jenkins slaves and nexus repository. This is managed by Docker Desktop for Windows.
My jenkins build job must build some docker image and push it into nexus repository.
So it fails when trying to login to nexus repo.
Here is the output:

Started by user Jenkins Admin 
Running as SYSTEM
Building remotely on 4cfe8bd0138d-52e3e5a3 (swarm swarm,java,docker) in workspace /var/jenkins_home/worker/workspace/build-amqp-worker
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
using credential d571ad3d-a2c1-4da4-89f9-9988c4b337a8
Cloning the remote Git repository
Cloning repository https://*********@bitbucket.org/*********/amqp-worker.git
 > git init /var/jenkins_home/worker/workspace/build-amqp-worker # timeout=10
Fetching upstream changes from https://*********@bitbucket.org/*********/amqp-worker.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials credentials at bitbucket
 > git fetch --tags --progress -- https://*********@bitbucket.org/*********/amqp-worker.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://*********@bitbucket.org/*********/amqp-worker.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://*********@bitbucket.org/*********/amqp-worker.git # timeout=10
Fetching upstream changes from https://*********@bitbucket.org/*********/amqp-worker.git
using GIT_ASKPASS to set credentials credentials at bitbucket
 > git fetch --tags --progress -- https://*********@bitbucket.org/*********/amqp-worker.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/feature/jni-load-******-lib^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/feature/jni-load-******-lib^{commit} # timeout=10
Checking out Revision 3e916b72b71d72ea9c0857da5d75b911088ccffc (refs/remotes/origin/feature/jni-load-******-lib)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 3e916b72b71d72ea9c0857da5d75b911088ccffc # timeout=10
Commit message: "dockerfile edit(use tgz expected to be downloaded)"
 > git rev-list --no-walk 3e916b72b71d72ea9c0857da5d75b911088ccffc # timeout=10
[Gradle] - Launching build.
[build-amqp-worker] $ /var/jenkins_home/worker/workspace/build-amqp-worker/gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
> Task :check
> Task :build

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 13s
5 actionable tasks: 5 executed
Build step 'Invoke Gradle script' changed build result to SUCCESS
[build-amqp-worker] $ /bin/sh -xe /tmp/jenkins2852215038696160800.sh
+ wget http://nexus:8081/repository/libcomponents/libcomponents/libfirst/1/libfirst-1.tgz -O libs.tgz
--2020-02-24 03:23:31--  http://nexus:8081/repository/libcomponents/libcomponents/libfirst/1/libfirst-1.tgz
Resolving nexus (nexus)... 10.0.5.7
Connecting to nexus (nexus)|10.0.5.7|:8081... connected.
HTTP request sent, awaiting response... 200 OK
Length: 128372 (125K) [application/x-tgz]
Saving to: ‘libs.tgz’

     0K .......... .......... .......... .......... .......... 39% 22.8M 0s
    50K .......... .......... .......... .......... .......... 79% 20.4M 0s
   100K .......... .......... .....                           100%  650M=0.005s

2020-02-24 03:23:31 (26.8 MB/s) - ‘libs.tgz’ saved [128372/128372]

[build-amqp-worker] $ /bin/sh -xe /tmp/jenkins4105019467446115917.sh
+ docker build -t prj-amqp-worker:48 .
Sending build context to Docker daemon  21.59MB

Step 1/4 : FROM adoptopenjdk/openjdk11:x86_64-alpine-jre-11.0.6_10
 ---> ecf655aa612f
Step 2/4 : COPY build/libs/******-amqp-worker-0.0.1-SNAPSHOT.jar /lib/p.jar
 ---> e2d8d481315e
Step 3/4 : ADD libs.tgz /usr/lib/
 ---> e45803fa3c52
Step 4/4 : CMD java -jar /lib/p.jar
 ---> Running in 3ae7f66d08b2
Removing intermediate container 3ae7f66d08b2
 ---> fb017f2cf5c6
Successfully built fb017f2cf5c6
Successfully tagged prj-amqp-worker:48
[build-amqp-worker] $ /bin/sh -xe /tmp/jenkins7088388474811604962.sh
+ docker login nexus:8083 -u **** -p ****
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get http://nexus:8083/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Build step 'Execute shell' marked build as failure
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

My nexus:8083 configuration is:
enter image description here

Here is related to nexus part of docker-compose.yml which used to deploy the stack (docker stack -c …):

  nexus:
    image: sonatype/nexus3
    volumes:
      - nexusvolume:/nexus-data
    ports:
      - "4343:8081"
      - "8083:8083"
      - "8082:8082"
    networks:
      - idclbuildnet
      - net1

I have configured insecure registries like this:
enter image description here
so docker json config is:

{
  "registry-mirrors": [],
  "insecure-registries": [
    "nexus:8082",
    "nexus:8083"
  ],
  "debug": true,
  "experimental": false
}

So why I am receiving an error message about timeout of docker login? Is it bad configuration of nexus’ private docker repo? Or it is something related to docker login mechanisms? Help please

Source: StackOverflow