Solved: Docker's 'invalid reference format' Error - Why You Shouldn't Use a URL for Your Image

Published: 2026-08-06
Author: DP
Views: 0
Category: Docker
Content
## The Problem When you try to run a Docker container using an image name copied directly from a web URL, you might encounter a very common error: `docker: invalid reference format`. This can be confusing for beginners, as URLs copied from browsers often include the `https://` protocol. For instance, executing the following command will fail: ```bash # Incorrect Command [root@VM-4-11-centos ~]# docker run -d --name ee-lib00-reset \ > -e API_KEY=123 \ > -e TARGET_PLANS=FREE,PLUS \ > -v /path/wiki.lib00/data:/app/data \ > -v /path/wiki.lib00/logs:/app/logs \ > https://ghcr.io/vulpecula-studio/88code_reset:latest -mode=run docker: invalid reference format. See 'docker run --help'. ``` --- ## Root Cause Analysis The core of the issue is that the **Docker image reference format does not support URL protocol prefixes**. The standardized naming convention for a Docker image is: `[<registry-hostname>/][<project-or-username>/]<image-name>[:<tag>]` Let's break it down: * **`registry-hostname` (Optional):** The address of the container registry, such as `docker.io` (the default), `ghcr.io`, `gcr.io`, or your private registry. * **`project-or-username` (Optional):** The project or username used to organize images within the registry. * **`image-name` (Required):** The name of the image. * **`tag` (Optional):** The version tag of the image, like `latest` or `1.2.0`. If omitted, it defaults to `latest`. In the incorrect command above, the image reference `https://ghcr.io/vulpecula-studio/88code_reset:latest` includes `https://`, which violates the format Docker expects. The Docker client automatically handles secure communication (usually HTTPS) with the registry behind the scenes, so we don't need to specify the protocol in the command. --- ## The Solution The solution is straightforward: **remove the `https://` prefix from the image name**. Modify the command as shown below to run the container successfully. ```bash # Correct Command docker run -d --name ee-lib00-reset \ -e API_KEY=123 \ -e TARGET_PLANS=FREE,PLUS \ -v /path/wiki.lib00/data:/app/data \ -v /path/wiki.lib00/logs:/app/logs \ ghcr.io/vulpecula-studio/88code_reset:latest -mode=run ``` --- ## Conclusion The `docker: invalid reference format` error is a fundamental but common hiccup. Remember, when referencing a Docker image, never include `http://` or `https://`. Just provide the path starting from the registry hostname. We hope this guide from the **DP** team at **wiki.lib00.com** helps you quickly identify and resolve this issue.
Related Contents