Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker build command for Dockerfile not in current directory

I have tried everything, looked up at least 20 similar questions, non could solve it.

I need a docker build command that reads my docker file nested inside the directory.

Docker file is located \Test\Backend\App%20Server\Dev\Test\Application

I have tried the following command none worked

docker build -t test-app -f . Test/Backend/App%20Server/Dev/Test/Application/Dockerfile

docker build -t test-app . Test/Backend/App%20Server/Dev/Test/Application/Dockerfile

docker build -t test-app -f Test/Backend/App%20Server/Dev/Test/Application/Dockerfile

docker build -t test-app -f . Test/Backend/App%20Server/Dev/Test/Application

Note: my Dockfile has the default name

Error returned

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

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

Build an image from a Dockerfile

like image 207
Jim_Mcdonalds Avatar asked Oct 20 '25 13:10

Jim_Mcdonalds


1 Answers

docker build -t test-app Test/Backend/App%20Server/Dev/Test/Application
like image 92
Hugo Avatar answered Oct 23 '25 09:10

Hugo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!