0

I haven't been able to run hello-world on command prompt but on quickstart terminal it works. Why is that? Error message on command prompt:

https://drive.google.com/file/d/0B0rw5s9roTIiWnpOM1JhVUNDZVU/view?usp=sharing

In a broader context, I am trying to run Docker compose to set up a network but unsuccessful. So I figure understanding more about Docker would be helpful. Appreciate any pointer. Thanks!

BMW
  • 42,880
  • 12
  • 99
  • 116
adamh
  • 5
  • 3

2 Answers2

0

(Please copy paste the error directly in your post)

From the screenshot, you run this command from Windows system. Did you install docker for windows in your windows system? To do this, you need check if your windows system is good enough to do that. Check Windows versions of Docker Engine, Compose, and Machine

If you installed Docker for Windows, then you should be fine to docker run hello-world directly.

Otherwise, you should choice to run with windows base image, lucky Docker company made this.

docker run run hello-world:nanoserver

You can compare the differences about hello-world:latest and hello-world:nanoserver

Dockerfile for image hello-world:nanoserver:

FROM microsoft/nanoserver
COPY hello.txt C:
CMD ["cmd", "/C", "type C:\\hello.txt"]

Dockerfile for image hello-world:latest

FROM scratch
COPY hello /
CMD ["/hello"]
BMW
  • 42,880
  • 12
  • 99
  • 116
  • thanks, tried running it with nanoserver, and come with following error message: C:\Users\User>docker run run hello-world:nanoserver docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.29/c ontainers/create: open //./pipe/docker_engine: The system cannot find the file s pecified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. See 'docker run --help'. – adamh Jun 22 '17 at 07:12
0

Docker is not supported natively on Windows7. It run in virtual box 'boot2docker' which provides it a linux environmental. The quickstart terminal is a special bash environment instead of the standard Windows command prompt, so you can't run docker commands on Windows command prompt.

Pointer-> https://docs.docker.com/toolbox/toolbox_install_windows/#what-you-get-and-how-it-works

However Docker is natively supported on Windows 10.

priyaranjan
  • 129
  • 3
  • Thanks for your answer. I have installed Docker Toolbox, for Windows versions prior to 10. I am curious why I could run it in quickstart [$ docker run hello-world], and not on cmd [docker run hello-world] . However, I am still trying to figure out how to make it work on command prompt, and further to set up a network. Thanks again for your tip! – adamh Jun 22 '17 at 07:11