bash - 在Google Colab中构建Docker容器: unknown flag -t

标签 bash docker installation google-colaboratory

我正在尝试通过以下代码将 github 存储库引入我的 Google Colab 工作区:

!git clone https://github.com/vanvalenlab/deepcell-tf.git
!cd deepcell-tf
!docker build -t $USER/deepcell-tf .

我已按照 Google Colab 的步骤安装 Docker ( https://colab.research.google.com/drive/10OinT5ZNGtdLLQ9K399jlKgNgidxUbGP )。

但是当我运行上面的代码时,出现以下错误:

invalid argument "/deepcell-tf" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.

“-t”是根据文档传递的有效参数。为什么它认为我将/deepcell-tf 作为参数传递?

最佳答案

-t确实是一个有效的标志:

--tag , -t Name and optionally a tag in the name:tag format

问题是您的 $USER 变量未设置,并且您的命令被解释为 docker build -t/deepcell-tf .,这是无效的用于命名图像的表单。

您需要确保在运行docker build之前导出$USER值,或者手动将其设置为有效值。例如:

docker build -t my-user/deepcell-tf .

关于bash - 在Google Colab中构建Docker容器: unknown flag -t,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58698669/

相关文章:

linux - 从 bash 启动顿悟浏览器并继续脚本

linux - bash 和 awk 脚本以 YYYY-MM-DD 格式获取上个月的日期

docker - 从官方 Dockerfile 构建 Google mtail 镜像失败

Python line_profiler 安装

regex - 从区域文件中提取 IP 和指针记录

bash - 如何使用bash杀死远程服务器上的多个进程

docker - 启动用户态代理 : listen tcp4 0. 0.0.0:80 时出错:绑定(bind):地址已在使用中

python - scrapy-cluster : socket.错误:[Errno 98]地址已在使用中

installation - winpcap静默安装

visual-studio - 安装应用程序中的 Visual Studio 2010 更新注册表