Skip to content

Docker API: empty or null Cmd prevents inheritance of the image’s default command #108

Open

Description

@neetkee

Description

Containers exit immediately in VMPal when a Docker API request includes an empty command ("Cmd": []) or "Cmd": null, even when the image defines a default command.

Redis is used below as a minimal example.

Steps to reproduce

With VMPal Containers enabled:

docker --context vmpal pull redis:8-alpine

curl --silent --show-error \
  --unix-socket "$HOME/.vmpal/docker.sock" \
  -H 'Content-Type: application/json' \
  -X POST \
  'http://localhost/containers/create?name=empty-command-test' \
  --data-binary \
  '{"Image":"redis:8-alpine","Cmd":[],"HostConfig":{"AutoRemove":false}}'

docker --context vmpal start empty-command-test

docker --context vmpal inspect empty-command-test \
  --format 'Command={{json .Config.Cmd}} Status={{.State.Status}} ExitCode={{.State.ExitCode}}'

Actual behavior

Command=[] Status=exited ExitCode=0

Redis never starts. The same happens with "Cmd": null.

Omitting Cmd, or explicitly setting "Cmd": ["redis-server"], starts Redis successfully.

Expected behavior

When no entrypoint override is supplied, the container should inherit the image’s default command.

For this example, the effective command should be ["redis-server"], and Redis should start.

This matches Docker Engine’s implementation, which falls back to the image command when the request’s command is empty.

This reproduction uses the Docker API directly. It does not involve Compose, whose command: [] setting has different semantics.

Versions tested

  • VMPal 0.112 (112)
  • VMPal container engine: 29.0.0-vmpal, API 1.52
  • Example image: redis:8-alpine

Activity

  1. changed the title [-][Bug] Docker API: Cmd null or [] prevents image CMD inheritance, breaking Redis and Testcontainers Ryuk[/-] [+]Docker API: empty or null `Cmd` prevents inheritance of the image’s default command[/+] on Oct 31, 2026
  2. nangtrongvuon commented on Nov 4, 2026

    @nangtrongvuon
    Collaborator

    Hi @neetkee this should be fixed with VMPal 116, could you test again to see if your issue persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions