Why does the pytorch Docker image not come with torch?
I am trying to build a docker container that will enable me to run my code that requires the python torch module. 

I have chosen to start my image from the pytorch/pytorch:latest base image and add a few required modules manually. The build, push, and pull to the remote server were successful (no error messages at least).

Currently my Dockerfile looks like this:

FROM pytorch/pytorch:latest

RUN apt-get update \
     &amp;&amp; apt-get install -y \
        libgl1-mesa-glx \
        libx11-xcb1 \
     &amp;&amp; apt-get clean all \
     &amp;&amp; rm -r /var/lib/apt/lists/*

RUN /opt/conda/bin/conda install --yes \
    astropy \
    matplotlib \
    pandas \
    glob2 \
    PIL \
    scikit-learn \
    scikit-image \
    numpy


However, when running my python script within the container, I get ImportError: No module named torch. This strikes me as rather weird, as it leads me to assume that the pytorch base image does not include the torch module...?

I have nevertheless tried to add torch to the list of modules to install in the Dockerfile, but then the initial build will already fail with the error message PackagesNotFoundError: The following packages are not available from current channels:  - torch. Following the advice given here did unfortunately not help me.

I'd appreciate any explanation as to why the torch module could not be found within the built container, and of course any help to fix this problem! Thanks!

First thing, your assumption is false, to verify this you just need to run the container from the base image, as you can check the official Dockerfile  or run first the base image that is pytorch/pytorch:latest
and verify does the base image working as you need?
Here is the list of installed modules in the official image and at bottom of the list, you can see the torch.

Here is a simple example from the torch using the base image.

As for your Dockerfile, so the package PIL is breaking the docker build from scratch, but this not visible if PyTorch is the base image.

For some reason, I am failed in the child image to find the torch so installed it using pip install and then its able to work.

Here is the Dockerfile:
FROM pytorch/pytorch:latest

RUN apt-get update \
     &amp;&amp; apt-get install -y \
        libgl1-mesa-glx \
        libx11-xcb1 \
     &amp;&amp; apt-get clean all \
     &amp;&amp; rm -r /var/lib/apt/lists/*

RUN /opt/conda/bin/conda install --yes \
    astropy \
    matplotlib \
    pandas \
    glob2 \
    scikit-learn \
    scikit-image \
    numpy \ 
    torch

Updated
Here is the way to make torch available
FROM pytorch/pytorch:latest

RUN apt-get update \
     &amp;&amp; apt-get install -y \
        libgl1-mesa-glx \
        libx11-xcb1 \
     &amp;&amp; apt-get clean all \
     &amp;&amp; rm -r /var/lib/apt/lists/*

RUN /opt/conda/bin/conda install --yes \
    astropy \
    matplotlib \
    pandas \
    scikit-learn \
    scikit-image 

RUN pip install torch


