Docker build gives “unable to prepare context: context must be a directory: /Users/tempUser/git/docker/Dockerfile”

前端 未结 7 1990
野趣味
野趣味 2021-01-31 12:57

I have a Dockerfile that is supposed to build an Ubuntu image. But whenever I run

docker build -t ubuntu-test:latest ./Dockerfile

it shows the fo

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 13:28

    I face the same issue. I am using docker version:17.09.0-ce.

    I follow below steps:

    1. Create Dockerfile and added commands for creating docker image
    2. Go to directory where we have created Dockfile
    3. execute below command $ sudo docker build -t ubuntu-test:latest .

    It resolved issue and image created successsfully.

    Note: build command depend on docker version as well as which build option we are using. :)

提交回复
热议问题