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 does one detect if one is running within a docker container within Python?
  • Start container in existing cgroup
  • docker registry with nginx: no such host
  • Golang Dockerfile Failing
  • docker-compose not showing any changes to code
  • Removing unused docker images on a remote Linux Azure hosted docker instance gives 'unknown shorthand flag: 'a' in -aq' error
  • postgres:
      restart: always
      image: kartoza/postgis:9.4-2.1
        - "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.


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

  • docker build fails - “cannot allocate memory”
  • Docker run command ignoring part of Dockerfile CMD when ENTRYPOINT present
  • Docker deployment workflow of new application release without loosing database state?
  • Apache not running automatically on docker compose up
  • docker container internal server applications
  • How to define custom primary_key for GCPLOGS driver with docker?
  • 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.