docker: “build” requires 1 argument. See 'docker build --help'

前端 未结 14 1927
太阳男子
太阳男子 2020-11-28 02:21

Trying to follow the instructions for building a docker image from the docker website.

https://docs.docker.com/examples/running_redis_service/

this is the er

相关标签:
14条回答
  • 2020-11-28 02:48

    You can build docker image from a file called docker file and named Dockerfile by default. It has set of command/instruction that you need in your docker container. Below command creates image with tag latest, Dockerfile should present on that location (. means present direcotry)

    docker build . -t <image_name>:latest
    

    You can specify the Dockerfile via -f if the file name in not default (Dockerfile) Sameple Docker file contents.

    FROM busybox
    RUN echo "hello world"
    
    0 讨论(0)
  • 2020-11-28 02:49

    The following command worked for me. Docker file was placed in my-app-master folder.

    docker build -f my-app-master/Dockerfile -t my-app-master .

    0 讨论(0)
提交回复
热议问题