Unable to run self-built images

Hi,all
I’m having trouble running my own image.
The following is my logs.

  2022-02-13T21:31:36.171+0800 [DEBUG] client: state changed, updating node and re-registering
    2022-02-13T21:31:36.201+0800 [INFO]  client: node registration complete
    2022-02-13T21:32:17.554+0800 [DEBUG] client: updated allocations: index=4593 total=1 pulled=1 filtered=0
    2022-02-13T21:32:17.554+0800 [DEBUG] client: allocation updates: added=1 removed=0 updated=0 ignored=0
    2022-02-13T21:32:17.569+0800 [DEBUG] client: allocation updates applied: added=1 removed=0 updated=0 ignored=0 errors=0
    2022-02-13T21:32:17.570+0800 [DEBUG] client.alloc_runner.task_runner: lifecycle start condition has been met, proceeding: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper
    2022-02-13T21:32:17.600+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.logmon: starting plugin: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper path=/usr/bin/nomad args=["/usr/bin/nomad", "logmon"]
    2022-02-13T21:32:17.601+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.logmon: plugin started: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper path=/usr/bin/nomad pid=2743
    2022-02-13T21:32:17.601+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.logmon: waiting for RPC address: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper path=/usr/bin/nomad
    2022-02-13T21:32:17.609+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.logmon.nomad: plugin address: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper @module=logmon address=/tmp/plugin3111257837 network=unix timestamp="2022-02-13T21:32:17.608+0800"
    2022-02-13T21:32:17.609+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.logmon: using plugin: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper version=2
    2022-02-13T21:32:17.610+0800 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper @module=logmon path=/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/alloc/logs/.zookeeper.stdout.fifo timestamp="2022-02-13T21:32:17.610+0800"
    2022-02-13T21:32:17.610+0800 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper path=/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/alloc/logs/.zookeeper.stderr.fifo @module=logmon timestamp="2022-02-13T21:32:17.610+0800"
    2022-02-13T21:32:17.759+0800 [DEBUG] client: updated allocations: index=4595 total=1 pulled=0 filtered=1
    2022-02-13T21:32:17.760+0800 [DEBUG] client: allocation updates: added=0 removed=0 updated=0 ignored=1
    2022-02-13T21:32:17.760+0800 [DEBUG] client: allocation updates applied: added=0 removed=0 updated=0 ignored=1 errors=0
    2022-02-13T21:32:27.635+0800 [DEBUG] client.driver_mgr.docker: image pull progress: driver=docker image_name=varqiao/nomadtest:latest message="No progress"
    2022-02-13T21:32:35.622+0800 [DEBUG] client.driver_mgr.docker: docker pull succeeded: driver=docker image_ref=varqiao/nomadtest:latest
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: image reference count incremented: driver=docker image_name=varqiao/nomadtest:latest image_id=sha256:ab184350003d0cedb771968e6f0ce308a33a4452a41a9173fd696dd8c32f130a references=1
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: configured resources: driver=docker task_name=zookeeper memory=209715200 memory_reservation=0 cpu_shares=100 cpu_quota=0 cpu_period=0
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: binding directories: driver=docker task_name=zookeeper binds="[]string{\"/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/alloc:/alloc\", \"/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/zookeeper/local:/local\", \"/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/zookeeper/secrets:/secrets\"}"
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: networking mode not specified; using default: driver=docker task_name=zookeeper
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: allocated static port: driver=docker task_name=zookeeper ip=10.0.16.9 port=28454 label=db
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: exposed port: driver=docker task_name=zookeeper port=28454 label=db
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: applied labels on the container: driver=docker task_name=zookeeper labels=map[com.hashicorp.nomad.alloc_id:d33a3a5b-d88d-f690-2689-1940f11f3cd7]
    2022-02-13T21:32:35.634+0800 [DEBUG] client.driver_mgr.docker: setting container name: driver=docker task_name=zookeeper container_name=zookeeper-d33a3a5b-d88d-f690-2689-1940f11f3cd7
    2022-02-13T21:32:35.754+0800 [INFO]  client.driver_mgr.docker: created container: driver=docker container_id=f47d22a701a959fba4b8318f54dba67c44cc4f65fd27a5757a74fb7e425690ce
    2022-02-13T21:32:36.602+0800 [INFO]  client.driver_mgr.docker: started container: driver=docker container_id=f47d22a701a959fba4b8318f54dba67c44cc4f65fd27a5757a74fb7e425690ce
    2022-02-13T21:32:36.611+0800 [DEBUG] client.driver_mgr.docker.docker_logger: starting plugin: driver=docker path=/usr/bin/nomad args=["/usr/bin/nomad", "docker_logger"]
    2022-02-13T21:32:36.611+0800 [DEBUG] client.driver_mgr.docker.docker_logger: plugin started: driver=docker path=/usr/bin/nomad pid=2968
    2022-02-13T21:32:36.611+0800 [DEBUG] client.driver_mgr.docker.docker_logger: waiting for RPC address: driver=docker path=/usr/bin/nomad
    2022-02-13T21:32:36.618+0800 [DEBUG] client.driver_mgr.docker.docker_logger.nomad: plugin address: driver=docker network=unix @module=docker_logger address=/tmp/plugin1126622877 timestamp="2022-02-13T21:32:36.618+0800"
    2022-02-13T21:32:36.618+0800 [DEBUG] client.driver_mgr.docker.docker_logger: using plugin: driver=docker version=2
    2022-02-13T21:32:36.620+0800 [DEBUG] client.driver_mgr.docker.docker_logger.nomad: using client connection initialized from environment: driver=docker @module=docker_logger timestamp="2022-02-13T21:32:36.620+0800"
    2022-02-13T21:32:36.624+0800 [DEBUG] client.driver_mgr.docker.docker_logger.stdio: received EOF, stopping recv loop: driver=docker err="rpc error: code = Unavailable desc = error reading from server: read unix @->/tmp/plugin1126622877: read: connection reset by peer"
    2022-02-13T21:32:36.625+0800 [DEBUG] client.driver_mgr.docker.docker_logger: plugin process exited: driver=docker path=/usr/bin/nomad pid=2968
    2022-02-13T21:32:36.625+0800 [DEBUG] client.driver_mgr.docker.docker_logger: plugin exited: driver=docker
    2022-02-13T21:32:36.627+0800 [DEBUG] client.alloc_runner.task_runner.task_hook.stats_hook: failed to start stats collection for task with unrecoverable error: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper error="container stopped"
    2022-02-13T21:32:36.661+0800 [DEBUG] client.driver_mgr.docker: image id reference count decremented: driver=docker image_id=sha256:ab184350003d0cedb771968e6f0ce308a33a4452a41a9173fd696dd8c32f130a references=0
    2022-02-13T21:32:36.662+0800 [INFO]  client.alloc_runner.task_runner: restarting task: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper reason="Restart within policy" delay=25.980693369s
    2022-02-13T21:32:36.841+0800 [DEBUG] client: updated allocations: index=4598 total=1 pulled=0 filtered=1
    2022-02-13T21:32:36.841+0800 [DEBUG] client: allocation updates: added=0 removed=0 updated=0 ignored=1
    2022-02-13T21:32:36.841+0800 [DEBUG] client: allocation updates applied: added=0 removed=0 updated=0 ignored=1 errors=0
    2022-02-13T21:33:02.656+0800 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper @module=logmon path=/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/alloc/logs/.zookeeper.stdout.fifo timestamp="2022-02-13T21:33:02.656+0800"
    2022-02-13T21:33:02.656+0800 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=d33a3a5b-d88d-f690-2689-1940f11f3cd7 task=zookeeper @module=logmon path=/data/nomad/client1/alloc/d33a3a5b-d88d-f690-2689-1940f11f3cd7/alloc/logs/.zookeeper.stderr.fifo timestamp="2022-02-13T21:33:02.656+0800"
    2022-02-13T21:33:02.920+0800 [DEBUG] client: updated allocations: index=4599 total=1 pulled=0 filtered=1
    2022-02-13T21:33:02.920+0800 [DEBUG] client: allocation updates: added=0 removed=0 updated=0 ignored=1
    2022-02-13T21:33:02.921+0800 [DEBUG] client: allocation updates applied: added=0 removed=0 updated=0 ignored=1 errors=0

I guess it was the mistake,but I don’t know how to solve it.

2022-02-13T21:32:36.624+0800 [DEBUG] client.driver_mgr.docker.docker_logger.stdio: received EOF, stopping recv loop: driver=docker err="rpc error: code = Unavailable desc = error reading from server: read unix @->/tmp/plugin1126622877: read: connection reset by peer"

Here is my configuration


job "zookeeper" {
  datacenters = ["beta"]
  type = "service"
  update {
    max_parallel = 1

    min_healthy_time = "10s"

    healthy_deadline = "3m"

    auto_revert = false

    canary = 0
  }

  group "cache" {

    count = 3

    restart {

      attempts = 10
      interval = "5m"
      delay = "25s"
      mode = "delay"
    }


    ephemeral_disk {

      size = 300
    }

    task "zookeeper" {
      driver = "docker"

      config {
        #image = "varqiao/nomadtest:latest"
        image = "varqiao/nomadtest:latest"
        port_map {
          db = 2181
        }
      }
      resources {
        cpu    = 100 # 500 MHz
        memory = 200 # 256MB
        network {
          mbits = 10
          port "db" {}
        }
      }

      service {
        name = "global-redis-check"
        tags = ["global", "cache", "urlprefix-/redis" ]
        port = "db"
        check {
          name     = "alive"
          type     = "tcp"
          interval = "10s"
          timeout  = "2s"
        }
      }
    }
  }

}

I can run a public image with this configuration, but I can’t run my own image. Thank you for your help.

Uploading: image.png…

I know what went wrong and the reason is my Docker image went wrong