Skip to content

[Tool #123] Docker Run to Compose accepts non-docker text as a valid command #377

Description

@baixiangcpp

Summary

Docker Run to Compose accepts arbitrary text that is not a docker run command and generates a Compose service from it instead of showing an input validation error.

Affected tool: Docker Run to Compose
Route: https://byteflow.tools/en/docker-run-to-compose
Observed during browser acceptance: 2026-08-18

Reproduction

  1. Open the affected route.
  2. Replace the command input with:
not a docker command
  1. Click Convert to Compose.
  2. Inspect the generated YAML.

Actual output

The converter treats the first word as an image name and produces a service equivalent to:

services:
not:
image: "not"command: ["a", "docker", "command"]

No error is shown, even though the input does not begin with docker run and is not a Docker Run command.

Expected output

The converter should validate the command before parsing it. For this input it should show an actionable error such as:

Invalid input: command must start with docker run

No Compose output should be generated for invalid command text.

Impact

Users can receive plausible-looking but incorrect Compose YAML from a typo or unrelated text and may assume the conversion is valid.

Regression coverage

Test docker run with flags, docker run without optional flags, empty input, unrelated shell text, and commands beginning with docker build or docker exec. Only valid docker run input should produce Compose output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions