Allow changing of distro at build time (#233)

* Allow changing of distro at build time

Ubuntu focal has better arm64 support for example.

* Document build-arg usage

* increase sleep time

as per https://github.com/kartoza/docker-postgis/pull/233#discussion_r409846863
pull/234/head^2
Eero af Heurlin 2020-04-20 13:05:39 +03:00 zatwierdzone przez GitHub
rodzic 8b12300b2b
commit b1308e3215
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 14 dodań i 2 usunięć

Wyświetl plik

@ -1,7 +1,8 @@
#--------- Generic stuff all our Dockerfiles should start with so we get caching ------------
ARG DISTRO=debian
ARG IMAGE_VERSION=buster
ARG IMAGE_VARIANT=-slim
FROM debian:$IMAGE_VERSION$IMAGE_VARIANT
FROM $DISTRO:$IMAGE_VERSION$IMAGE_VARIANT
MAINTAINER Tim Sutton<tim@kartoza.com>
# Reset ARG for version

Wyświetl plik

@ -80,6 +80,17 @@ Now edit ``71-apt-cacher-ng`` then do:
docker build -t kartoza/postgis .
```
### Building with alternative base distributions
There are build args for `DISTRO` (=debian), `IMAGE_VERSION` (=buster)
and `IMAGE_VARIANT` (=slim) which can be used to control the base image used
(but it still needs to be Debian based and have PostgreSQL official apt repo).
For example making Ubuntu 20.04 based build (for better arm64 support)
```
docker build --build-arg DISTRO=ubuntu --build-arg IMAGE_VERSION=focal --build-arg IMAGE_VARIANT="" -t kartoza/postgis .
```
## Run

Wyświetl plik

@ -8,7 +8,7 @@ source ../test-env.sh
# Run service
docker-compose up -d
sleep 5
sleep 30
services=("pg-default" "pg-new" "pg-recreate")