Skip to content

Compose deploy wraps service command in 'sh -c' appended after image ENTRYPOINT, breaking entrypoint+CMD images #332

Description

@tizerluo

Bug

When deploying a compose-style service with a command, Openship creates the container with Cmd=["sh","-c","<command>"] while preserving the image ENTRYPOINT. For images whose entrypoint is a binary that takes the command as argv (e.g. ENTRYPOINT ["node","dist/index.js"], CMD ["mcp"]), the process receives argv = ["sh","-c","<command>"], fails to parse it, prints usage and exits — the container restart-loops.

Reproduce

  1. Create a folder-upload project with this compose:
services:
  app:
    image: ghcr.io/knockoutez/wigolo:0.2.1-full   # ENTRYPOINT ["node","dist/index.js"], CMD ["mcp"]
    command: ["serve", "--host", "0.0.0.0"]
    ports: ["127.0.0.1:3333:3333"]
  1. Deploy to a server. Deployment reports ready, but docker inspect shows Cmd=["sh","-c","serve --host 0.0.0.0"] and the container restart-loops with exit code 1 (CLI prints its help text).

Both the compose list form (command: ["serve","--host","0.0.0.0"]) and a JSON-array string in the service API end up wrapped in sh -c.

Expected

Compose command (string or list) should map to the container Cmd (overriding image CMD), per docker-compose semantics — no sh -c wrapping appended after the entrypoint. If shell interpretation is needed, replacing the entrypoint or documenting the behavior would avoid silent breakage.

Workaround we used

Build a derivative image that bakes the args into ENTRYPOINT (ENTRYPOINT ["node","dist/index.js","serve","--host","0.0.0.0"], CMD []) and leave the service command empty — Openship accepts local (non-registry) images, which made this possible.

Environment: Openship self-hosted (cloud context), deployed 2026-07-30, target server Ubuntu 26.04 / Docker 29.6.2.

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