mamcx
mamcx

Reputation: 16196

Docker build "no such file or directory" but work with docker-compose

I try to register with gitlab a image:

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

But I get:

Step 4/7 : COPY ./requirements /requirements lstat requirements: no such file or directory

However build with compose work:

docker-compose -f dev.yml build python


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

The file structure:

-Project/requirements -Project/compose/base

How I replicate what compose do?

Upvotes: 0

Views: 936

Answers (1)

German
German

Reputation: 1705

Your problem is in docker build context, i suggest you try this:

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

Upvotes: 1

Related Questions