Where does Docker know where to pull the .sh scripts from when building a Dockerfile?

So here is a Dockerfile. https://hub.docker.com/r/kartoza/postgis/~/dockerfile/

I am trying to use this in my Docker-Compose like so:

  • How to import SHP file into docker PostgreSQL container?
  • Bind to docker socket on Windows
  • Supervisord in Docker + AWS Elastic Beanstalk can't accept non-alphanumeric environment variables
  • Docker fixed date
  • Update a Docker Image on an EC2 Instance
  • Docker daemon can't initialize network controller
  • postgres:
    
      restart: always
    
      image: kartoza/postgis:9.4-2.1
    
      ports:
    
        - "5432:5432"
    

    My question is, if you go back to that link and look at the Dockerfile, at the very bottom it is running start_postgres.sh and some other sh scripts. How does docker know where to pull those sh scripts from? I know there is a Kartoza/postgis github repo that has the scripts, but nowhere in the Dockerfile or my docker-compose is there any step to pull or point to the GitHub repo so I am totally confused where these scripts are pulled from when I run my docker-compose.

    volumes:

    - pgdata:/var/lib/postgresql/data/
    

  • How to transfer a environment variable into a dockerfile
  • docker—run nginx not allways working
  • Docker: Add a restart policy to a container that was already created
  • Pull docker image from AWS ECR using remote API
  • Artifactory docker registry docker image
  • Installing Docker.io on Ubuntu 14.04LTS
  • One Solution collect form web for “Where does Docker know where to pull the .sh scripts from when building a Dockerfile?”

    The Dockerfile on Dockerhub is just for documentation purposes, the complete github repo is used to build the image, hence the scripts are available through Docker’s build context:

    $ docker build https://github.com/kartoza/docker-postgis
    

    Only using the linked Dockerfile will result in a build error.

    Edit: To clarify, Docker Hub is an image repository. Built images are either uploaded or built by Docker Hub from a provided github repository. Other users can then simply download (pull) those images.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.