Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build, reports : "Error: the Dockerfile (Dockerfile) can't be empty. However it exists within same dir #5170

Closed
danieldram opened this issue Sep 4, 2017 · 5 comments

Comments

@danieldram
Copy link

I am not sure how to solve this issue.. I tried for an hour.
I uninstalled previous versions of Docker and docker-compose, I reinstalled the new docker for macosx.

The dir structure ha both the docker-compose.yml and Dockerfile in the same directory, here are the files:
#Dockerfile

FROM node:latest
MAINTAINER Daniel Ram
COPY . /var/www
WORKDIR /var/www

RUN npm install
EXPOSE 3000
CMD ["npm", "start"]

#docker-compose.yml

version: '2'
services:
  playthis_server:
    build:
      context: .
      dockerfile: Dockerfile
    logging:
      driver: "json-file"
      options:
          max-size: "1000m"
          max-file: "10"
    ports:
        # - "80:3000"
        - "3003:3003"
    restart: "always"
    networks:
        - app
networks:
  app:
    driver: bridge

After running this command, it fails to build:

$docker-compose up -d

Building playthis_server
ERROR: the Dockerfile (Dockerfile) cannot be empty
daniels-MacBook-Pro:creators danielram$ 

Any ideas on how to solve this issue?

@danieldram
Copy link
Author

danieldram commented Sep 5, 2017

I figured out the problem.... In Dockerfile.

COPY

is now

ADD

can be closed.. :|

@Lilikh
Copy link

Lilikh commented Aug 26, 2021

I have a problem with the same error and I don't know how could I solve it. :(

@lucas-oliaro
Copy link

I had a similar problem and the solution was to save the file again with the modifications

@yogesh-0512
Copy link

I too face that same problem. Enable autosave in Visual Studio code and build. it will run without any errors.

@ramzan-git
Copy link

I'm too face that same problem. Save the docker file, then try again. Enable autosave in Visual Studio code and build. it will run without any errors.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants