david
david

Reputation: 6795

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:

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/

Upvotes: 1

Views: 125

Answers (1)

Erik Dannenberg
Erik Dannenberg

Reputation: 6106

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.

Upvotes: 2

Related Questions