louislam/dockge · warning · Error

Please enter a docker run command

Error message

Please enter a docker run command

What it means

In frontend/src/pages/DashboardHome.vue, convertDockerRun() refuses to convert a docker run command to compose when the input is effectively empty — exactly or essentially just 'docker run' with no arguments. It throws this error to stop the client from sending a pointless composerize request to the backend, since composerize cannot produce a meaningful compose file without an image or options.

Source

Thrown at frontend/src/pages/DashboardHome.vue:249

                }
            });
        },

        getStatusNum(statusName) {
            let num = 0;

            for (let stackName in this.$root.completeStackList) {
                const stack = this.$root.completeStackList[stackName];
                if (statusNameShort(stack.status) === statusName) {
                    num += 1;
                }
            }
            return num;
        },

        convertDockerRun() {
            if (this.dockerRunCommand.trim() === "docker run") {
                throw new Error("Please enter a docker run command");
            }

            // composerize is working in dev, but after "vite build", it is not working
            // So pass to backend to do the conversion
            this.$root.getSocket().emit("composerize", this.dockerRunCommand, (res) => {
                if (res.ok) {
                    this.$root.composeTemplate = res.composeTemplate;
                    this.$router.push("/compose");
                } else {
                    this.$root.toastRes(res);
                }
            });
        },

        /**
         * Updates the displayed records when a new important heartbeat arrives.
         * @param {object} heartbeat - The heartbeat object received.
         * @returns {void}

View on GitHub (pinned to f809ae192b)

Solutions

  1. Type or paste the full docker run command including the image (e.g. `docker run -d -p 8080:80 nginx`)
  2. Clear the field and paste the complete command from your notes or shell history
  3. Check that no leading/trailing content is missing after trimming whitespace
  4. Retry the conversion after the command includes at least an image name

Example fix

// before
this.dockerRunCommand = "docker run";
this.convertDockerRun(); // throws
// after
const cmd = this.dockerRunCommand.trim();
if (cmd !== "docker run" && cmd.split(/\s+/).length > 2) {
  this.convertDockerRun();
}
Defensive patterns

Strategy: validation

Validate before calling

const cmd = this.dockerRunCommand.trim();
if (!cmd || cmd === "docker run" || cmd.split(/\s+/).length < 3) {
  showError("Enter a full docker run command including the image.");
  return;
}

Try / catch

try {
  this.convertDockerRun();
} catch (e) {
  if (e.message === "Please enter a docker run command") {
    this.showError("Paste your full docker run command (e.g. docker run -d -p 80:80 nginx).");
  } else throw e;
}

Prevention

When it happens

Trigger: Clicking the convert button while the docker-run input contains only the placeholder/default text 'docker run' (trim() === 'docker run'), i.e. no image, ports, volumes, or flags were entered.

Common situations: Users clicking convert before typing anything, with the input pre-filled by the 'docker run' template; pasting whitespace that gets trimmed back to the default; UI state reset leaving the default command in place.

Related errors


AI-assisted analysis of louislam/dockge@f809ae192b (2026-08-31). Data as JSON: /api/errors/08630043ec243738. Report an issue: GitHub.