none
How do I run the sample-python image on Windows 10 Hyper V (build 14367.rs1_release.160613-1700) RRS feed

  • Question

  • Hello all,

    I just completed the Windows 10 quick start tutorial and now I'm trying to experiment a little.

    I tried to pull the sample python image using the following command:

    docker pull microsoft/sample-python

    The command failed with the following output.

    Using default tag: latest
    latest: Pulling from microsoft/sample-python
    
    2b351720f076: Extracting [==================================================>]   1.3 kB/1.3 kB
    f366fbda0398: Download complete
    7b5b97491631: Download complete
    failed to register layer: layer does not exist

    I was able to workaround this using the following command:

    docker pull microsoft/sample-python:nanoserver
    PS C:\WINDOWS\system32> docker images
    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
    microsoft/sample-dotnet   latest              28da49c3bff4        8 days ago          918.3 MB
    microsoft/sample-ruby     nanoserver          4ee00b4027ce        9 days ago          861.2 MB
    microsoft/sample-python   nanoserver          bdd993af9a12        9 days ago          898.1 MB
    nanoserver                10.0.14300.1016     3f5112ddd185        4 weeks ago         810.2 MB
    nanoserver                latest              3f5112ddd185        4 weeks ago         810.2 MB

    Now I want to run the sample-python image

     docker run --isolation=hyperv --rm microsoft/sample-python

    And I receive the following output

    Unable to find image 'microsoft/sample-python:latest' locally
    latest: Pulling from microsoft/sample-python
    
    2b351720f076: Extracting [==================================================>]   1.3 kB/1.3 kB
    f366fbda0398: Download complete
    7b5b97491631: Download complete
    C:\Program Files\Docker\docker.exe: failed to register layer: layer does not exist.
    See 'C:\Program Files\Docker\docker.exe run --help'.

    It appears as though the run command doesn't find the image locally and tries to pull on demand but pulls the Window Server Core version which doesn't work on Windows 10. So I tried:

     docker run --isolation=hyperv --rm microsoft/sample-python:nanoserver

    Which results in the following output:

    C:\Program Files\Docker\docker.exe: Error response from daemon: No command specified.
    See 'C:\Program Files\Docker\docker.exe run --help'.
    So, how do I run the sample-python image on Windows 10 Hyper V (build 14367.rs1_release.160613-1700)?

    Friday, June 17, 2016 10:37 PM

Answers

  • The image can be tagged, which will shorten the 'docker run' command.

    docker tag bdd993af9a12 python:latest

    With this complete, you can either run a container and start an 'interactive' session specifying a process to run, or create a dockerfile that uses this image and a CMD or ENTRYPOINT to specify the process.

    For example, the following will start an instance of the image and drop you into a cmd session.

    docker run -it --isolation=hyperv python cmd

    From there, python can be tested:

    c:\python35\python
    >>> print("Hello World")
    Hello World

    After a quick look at this image, it looks like the Python directory has not been added to path, and maybe some other oddities, but looks like it is working.

    Hope this helps.

    neilp


    Saturday, June 18, 2016 4:17 AM

All replies

  • The image can be tagged, which will shorten the 'docker run' command.

    docker tag bdd993af9a12 python:latest

    With this complete, you can either run a container and start an 'interactive' session specifying a process to run, or create a dockerfile that uses this image and a CMD or ENTRYPOINT to specify the process.

    For example, the following will start an instance of the image and drop you into a cmd session.

    docker run -it --isolation=hyperv python cmd

    From there, python can be tested:

    c:\python35\python
    >>> print("Hello World")
    Hello World

    After a quick look at this image, it looks like the Python directory has not been added to path, and maybe some other oddities, but looks like it is working.

    Hope this helps.

    neilp


    Saturday, June 18, 2016 4:17 AM
  • Hi Neil,

    Thanks for the prompt response!

    I'm sure I'll be asking a lot more questions in the future.

    Thanks again,

    Avinash.

    Saturday, June 18, 2016 3:48 PM