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:

  • Docker compose linking appears to not work
  • How to auto reload spring boot application in docker using spring dev tools
  • Unable to download docker golang image: No command specified
  • How to find the creation date of an image in a (private) Docker registry (API v2)?
  • Docker image format
  • ElasticBeanstalk: storing a bullet proof docker container
  • 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/

  • How packaging and deployment works in Azure ?
  • Are docker containers destroyed when machine is restarted?
  • My nodes Digital Ocean are UNREACHABLE from docker cloud
  • Running Docker for Windows, Error when exposing Ports
  • Kubernetes error pulling of local registry
  • How do I capture the console output for a container launched on ECS?
  • 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.