You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Ubuntu14.04/CUDA8.0的Dockerfile构建镜像报错Invalid Reference Format求助

Fixing "invalid reference format" Error in Docker Build

Looks like the issue is that your Dockerfile uses an ARG variable IMAGE_NAME but you're not providing a value for it when running docker build, which leads to an invalid image reference in the FROM line.

Why this happens

Your Dockerfile starts with:

ARG IMAGE_NAME
FROM ${IMAGE_NAME}:8.0-devel-ubuntu14.04

When you run docker build without passing a value for IMAGE_NAME, Docker substitutes it with an empty string. That turns your FROM line into FROM :8.0-devel-ubuntu14.04—which is clearly an invalid image reference, hence the error.

Solution 1: Pass the argument during build

You need to use the --build-arg flag to specify the base image name (I assume you're using the official NVIDIA CUDA image here). Run your build command like this:

docker build --build-arg IMAGE_NAME=nvidia/cuda -t your-custom-image /home/anil/Desktop/container

Replace your-custom-image with whatever name you want to give your built image.

Solution 2: Set a default value for the ARG in Dockerfile

If you don't want to pass the argument every time, you can set a default value directly in your Dockerfile:

ARG IMAGE_NAME=nvidia/cuda
FROM ${IMAGE_NAME}:8.0-devel-ubuntu14.04
# Rest of your Dockerfile steps...

Now you can run the original docker build /home/anil/Desktop/container command without extra flags, and Docker will use nvidia/cuda as the base image name by default.

Just double-check that the base image nvidia/cuda:8.0-devel-ubuntu14.04 exists (it should, as it's an official NVIDIA image) and your Docker daemon can pull it if it's not already cached locally.

内容的提问来源于stack exchange,提问作者Rachna Pathak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:12:37