【问题标题】:Docker build "no such file or directory" but work with docker-composeDocker 构建“没有这样的文件或目录”但使用 docker-compose
【发布时间】:2017-06-06 15:50:30
【问题描述】:

我尝试用 gitlab 注册一张图片:

docker build -t registry.gitlab.com/xxx/xxx compose/base

但我明白了:

第 4/7 步:复制 ./requirements /requirements lstat 要求:否 这样的文件或目录

但是使用 compose 构建:

docker-compose -f dev.yml build python


services:
  python:
    build:
      context: .
      dockerfile: ./compose/base/Dockerfile

文件结构:

-项目/要求 -项目/撰写/基础

我如何复制 compose 的功能?

【问题讨论】:

    标签: docker docker-compose gitlab-ci


    【解决方案1】:

    您的问题出在 docker build 上下文中,我建议您试试这个:

    docker build -t registry.gitlab.com/xxx/xxx -f compose/base/Dockerfile .
    

    【讨论】:

      猜你喜欢
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      • 2020-04-05
      • 2022-11-17
      • 1970-01-01
      • 1970-01-01
      • 2020-04-18
      • 2021-05-26
      相关资源
      最近更新 更多