Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I cant call my Dockerfiles something else

My code solution contains a shared project, web frontend and web api project. Due to Dockerfile can’t access parent folders the Dockerfiles need to be at the root folder i figure (frontend and api both depend on shared).

So I have Dockerfile.api which is allowed if I have version 1.8 or greater (https://github.com/moby/moby/wiki). I do, I have the latest 4.2

Calling Dockerfile (web api) is successful, but calling docker build -f Dockerfile.api results in this error:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

What am I missing here? As my repo contains different projects that will result in different images I want different Dockerfiles, and they need to be at the root due to dependencies.

>Solution :

docker build need to have a path argument where the build should be executed.

So the correct command will be:

docker build -f Dockerfile.api .
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading