Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (2.3k points)

So I've been getting into docker and for this, I've been following the docker documentation.So for my doubt, I've been specifically following this instruction for creating a docker image :

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

But I keep on getting an error while following it exactly, here are my dockerfile and build command and the error:

My dockerfile :

FROM        ubuntu:14.04
RUN         apt-get update && apt-get install -y redis-server
EXPOSE      6379
ENTRYPOINT  ["/usr/bin/redis-server"]

Docker build command :

$ sudo docker build -t myrepo/redis
Error :

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

Can someone help me out?, please? 

closed

1 Answer

0 votes
by (6.9k points)
selected by
 
Best answer

There error is that you forgot to add the dot after 'build'

You need to type in the command like this :

$ sudo docker build . -t < name >

The dot basically tells docker that the dockerfile that has to be used is in the current directory.

If you wish to specify a dockerfile that is not located in the local/current directory you can do so in docker v 1.5 like so :

$ sudo docker build --file="" -t < name >

Here --file specifies Name of the Dockerfile where the Default is ‘PATH/Dockerfile’.

Try typing in the commands when you refer tutorials and instructions, you will get less such errors and more practice.

Hope that helped :)


Docker can be tough to learn by self, if you wish to be taught by professionals refer to Docker training course.

Browse Categories

...