Volumes in Docker with balance / services

0

Good afternoon. I need to generate volumes for a container, but the mounts are not being generated. I am using the following syntax when creating the service:

docker service create --name $LC_SERVICE_NAME --replicas 1 --with-registry-auth $LC_SECRETS --network corporate --publish 9001:80 $LC_IMAGE:$LC_TAG --mount source=/var/bankreturn,target=/var/bankreturn --mount source=/var/bankreturn/error,target=/var/bankreturn/error --mount source=/var/bankreturn/input,target=/var/bankreturn/input --mount source=/var/bankreturn/processing,target=/var/bankreturn/processing --mount source=/var/bankreturn/success,target=/var/bankreturn/success --mount source=/var/bankreturn/temporary,target=/var/bankreturn/temporary

When giving an inspect in the container, nothing is created in the object "Volumes".

[
    {
        "Id": "eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e",
        "Created": "2018-03-09T20:11:23.491659862Z",
        "Path": "dotnet",
        "Args": [
            "Acesso.BankReturn.Service.dll",
            "--mount",
            "source=/var/bankreturn,target=/var/bankreturn",
            "--mount",
            "source=/var/bankreturn/error,target=/var/bankreturn/error",
            "--mount",
            "source=/var/bankreturn/input,target=/var/bankreturn/input",
            "--mount",
            "source=/var/bankreturn/processing,target=/var/bankreturn/processing",
            "--mount",
            "source=/var/bankreturn/success,target=/var/bankreturn/success",
            "--mount",
            "source=/var/bankreturn/temporary,target=/var/bankreturn/temporary"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 2803,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-03-09T20:11:26.727751025Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:a16dc65817a7a0f3f3312bea0a659ca8fee26168053cb724365332ce48aa9739",
        "ResolvConfPath": "/var/lib/docker/containers/eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e/hostname",
        "HostsPath": "/var/lib/docker/containers/eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e/hosts",
        "LogPath": "/var/lib/docker/containers/eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e/eb8dcacc8c2f6b60dfcff783cfdbff0bdaf1114cd8df015b57324ae00a77965e-json.log",
        "Name": "/acesso-bankreturn.1.jqz53umombybbkpr0qpx6d4hv",
        "RestartCount": 0,
        "Driver": "aufs",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Name": "aufs",
            "Data": null
        },
        "Mounts": [],
        "Config": {
            "Hostname": "eb8dcacc8c2f",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DOTNET_VERSION=2.0.5",
                "DOTNET_DOWNLOAD_URL=https://dotnetcli.blob.core.windows.net/dotnet/Runtime/2.0.5/dotnet-runtime-2.0.5-linux-x64.tar.gz",
                "DOTNET_DOWNLOAD_SHA=21D54E559C5130BB3F8C38EADACB7833EC90943F71C4E9C8FA2D53192313505311230B96F1AFEB52D74D181D49CE736B83521754E55F15D96A8756921783CD33",
                "ASPNETCORE_URLS=http://+:80",
                "ASPNETCORE_PKG_VERSION=2.0.5"
            ],
            "Cmd": [
                "--mount",
                "source=/var/bankreturn,target=/var/bankreturn",
                "--mount",
                "source=/var/bankreturn/error,target=/var/bankreturn/error",
                "--mount",
                "source=/var/bankreturn/input,target=/var/bankreturn/input",
                "--mount",
                "source=/var/bankreturn/processing,target=/var/bankreturn/processing",
                "--mount",
                "source=/var/bankreturn/success,target=/var/bankreturn/success",
                "--mount",
                "source=/var/bankreturn/temporary,target=/var/bankreturn/temporary"
            ],
            "Image": "acessocard-docker.jfrog.io/cico/bankreturn@sha256:cb0b34656178ae3aef7de88aa8f51e89c28c577cf8b79a0fe9b7c4e167ab02ff",
            "Volumes": null,
            "WorkingDir": "/app",
            "Entrypoint": [
                "dotnet",
                "Acesso.BankReturn.Service.dll"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.swarm.node.id": "6tn4fwh3wpfgrfj1swd9djw05",
                "com.docker.swarm.service.id": "xmerld0neauao8qbtoj61gd67",
                "com.docker.swarm.service.name": "acesso-bankreturn",
                "com.docker.swarm.task": "",
                "com.docker.swarm.task.id": "jqz53umombybbkpr0qpx6d4hv",
                "com.docker.swarm.task.name": "acesso-bankreturn.1.jqz53umombybbkpr0qpx6d4hv"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "689b5954ccf0239b7807e9dbbd81c93d59de88c51d53fdf78c8a69492861b023",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/689b5954ccf0",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "corporate": {
                    "IPAMConfig": {
                        "IPv4Address": "10.0.1.34"
                    },
                    "Links": null,
                    "Aliases": [
                        "eb8dcacc8c2f"
                    ],
                    "NetworkID": "weyjfrv37j9qy71l9cti1e7ca",
                    "EndpointID": "83aec692883a52492728e01b1e4fd58e2ba2a3e0626a3a40267bf506e14ae563",
                    "Gateway": "",
                    "IPAddress": "10.0.1.34",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:0a:00:01:22"
                },
                "ingress": {
                    "IPAMConfig": {
                        "IPv4Address": "10.255.0.35"
                    },
                    "Links": null,
                    "Aliases": [
                        "eb8dcacc8c2f"
                    ],
                    "NetworkID": "kk3agjaa27jci0q70efx74xzv",
                    "EndpointID": "57b0f1a85aba683133adfc653e2e0fd4fff11499b459641cfbae8a46e13c8867",
                    "Gateway": "",
                    "IPAddress": "10.255.0.35",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:0a:ff:00:23"
                }
            }
        }
    }
]

The company is using balance servers here (3 in all) and I noticed that between them, the volumes differ from each other.

Soon, one server can not see the volume of another via "docker volume ls" command.

In addition, I realized that the service is being generated on one server and the container on another. Could that be influencing something? What should I do? Can you help me?

Thank you in advance.

    
asked by anonymous 09.03.2018 / 21:58

0 answers