How to see underlying docker command for my task?

I have this group/task:

  group "postgres-db" {
    count = 1

    restart {
      attempts = 10
      interval = "5m"
      delay    = "10s"
      mode     = "delay"

    network {
      port "postgres-db" {
        static = 5432
        to     = 5432

    task "postgres-task" {

      driver = "docker"

      config {
        force_pull = false
        image = "org/userdb:v15"
        ports = ["postgres-db"]

        auth {
          username = "*"
          password = "*"


      env {
        SERVICE_NAME = "postgres-node"
        SERVICE_ID = 1
        WALE_LOG_DESTINATION = "stderr"

        S3_REGION = "us-west-2"
        ACCESS_KEY_ID = "*"
        SECRET_ACCESS_KEY_ID = "*"


        CONTINOUS_BACKUP = "s3"
        BACKUP_S3 = "true"
        S3_PREFIX = "s3://${var.project_name}-logs/backups"

During the start of this container: I see next log messages:
Feb 21, '24 22:18:47 -0500 Terminated Exit Code: 1, Exit Message: “Docker container exited with non-zero exit code: 1”

Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":

You can see that I have passed ‘POSTGRES_HOST_AUTH_METHOD’. Is there a way to see exactly what is coming on?
I want to see the docker run ... command which is executed by nomad. I want to see all output from postgres container like I did before : docker logs postggres.
Is there a way to do this?
I tried nomad operator debug, but in that created archive I can not find the information I am interesting in. Would be nice if this is possible to prevent docker container so I can inspect it and analyze logs.

Thank you.

Nomad doesn’t directly expose the docker run command it uses. To troubleshoot or mimic the command, you can:

  1. View logs with nomad alloc logs <alloc-id> <task-name> for output similar to docker logs.
  2. Manually construct a docker run command based on your Nomad task configuration for debugging.
  3. Ensure all required environment variables are correctly set in your Nomad job specification.
  4. Use nomad job status and nomad alloc status for more details on job and allocation status.
  5. Adjust your task’s configuration for debugging purposes, if necessary, to prevent the container from exiting immediately.