0

I am trying to use centos6.6 in Dockerfile, I tried following both lines one by one in my Dockerfile:

FROM centos:centos6.6
FROM centos:6.6

But getting this error while running docker:

root@onl-dev:/distros/trial# docker run -it trial
docker: Error response from daemon: No command specified.
See 'docker run --help'.

Can someone suggest me if I am missing anything here?

1 Answers1

1

The error seems pretty clear: you haven't specified a command to run, either in your Dockerfile or on the command line. You could try:

docker run -it trial bash

...if you want a shell. Or you could add to your Dockerfile:

CMD ["bash"]

...and now your image would run this by default if no command is provided on the command line.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • In theory, [CentOS base image](https://github.com/CentOS/sig-cloud-instance-images/blob/939b4dc62009b1cdc3857f19996b1fd749b047f7/docker/Dockerfile) already specifies bash as the CMD – Roman Oct 29 '16 at 01:52