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 error I get will following the instructions on the doc and using this Dockerfile
FROM ubuntu:14.04 RUN apt-get update && apt-get install -y redis-server EXPOSE 6379 ENTRYPOINT ["/usr/bin/redis-server"] sudo docker build -t myrepo/redis docker: "build" requires 1 argument. See 'docker build --help'.
How do resolve?
Due to Insufficient Arguments By default we provided dot(.) in the command which specifies the Docker daemon to use the shell's current working directory as the build context: $ docker build . In order to solve this issue, we need to provide the correct file name with -f option.
There is a “.” (dot) at the end of the command (which is an alias for $PWD current directory). This tells docker the that the resources for building the image are in the current directory. By default, when you run the docker build command, it looks for a file named Dockerfile in the current directory.
You can use the ARG command inside a Dockerfile to define the name of a parameter and its default value. This default value can also be overridden using a simple option with the Docker build command.
Description. The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in the specified PATH or URL . The build process can refer to any of the files in the context. For example, your build can use a COPY instruction to reference a file in the context ...
You need to add a dot, which means to use the Dockerfile in the local directory.
For example:
docker build -t mytag .
It means you use the Dockerfile in the local directory, and if you use docker 1.5 you can specify a Dockerfile elsewhere. Extract from the help output from docker build:
-f, --file="" Name of the Dockerfile(Default is 'Dockerfile' at context root)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With