diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9eae36e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.idea/ +.git/ +.gitignore +README.md +LICENCE \ No newline at end of file diff --git a/.github/workflows/v1.0.yml b/.github/workflows/v1.0.yml deleted file mode 100644 index b42fb81..0000000 --- a/.github/workflows/v1.0.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Publish GraphIP Postgres Image [1.0] -on: [push] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: graphip/postgres - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/v11.yml b/.github/workflows/v11.yml new file mode 100644 index 0000000..a8cc790 --- /dev/null +++ b/.github/workflows/v11.yml @@ -0,0 +1,22 @@ +name: Publish GraphIP Postgres Image [11] +on: + push: + schedule: + - cron: '20 1 * * wed' # every wednesday @ 01:20 +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + ref: 11 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + env: + MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} + with: + name: graphip/postgres + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + buildargs: MAXMIND_LICENSE_KEY + tags: "11" \ No newline at end of file diff --git a/.github/workflows/v12.yml b/.github/workflows/v12.yml new file mode 100644 index 0000000..4786efa --- /dev/null +++ b/.github/workflows/v12.yml @@ -0,0 +1,19 @@ +name: Publish GraphIP Postgres Image [12] +on: + push: + schedule: + - cron: '0 1 * * wed' # every wednesday @ 01:00 +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + env: + MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} + with: + name: graphip/postgres + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + buildargs: MAXMIND_LICENSE_KEY \ No newline at end of file diff --git a/.github/workflows/v13.yml b/.github/workflows/v13.yml new file mode 100644 index 0000000..bc16252 --- /dev/null +++ b/.github/workflows/v13.yml @@ -0,0 +1,22 @@ +name: Publish GraphIP Postgres Image [13] +on: + push: + schedule: + - cron: '10 1 * * wed' # every wednesday @ 01:10 +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + ref: 13 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + env: + MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} + with: + name: graphip/postgres + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + buildargs: MAXMIND_LICENSE_KEY + tags: "latest,13" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 30995fb..5431b23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,26 @@ -FROM postgres:11 +FROM postgres:12 -LABEL maintainer="AIGIS Services Ltd" +LABEL maintainer="Lotus Labs Ltd" -RUN apt-get update && apt-get install postgresql-11-ip4r -y \ No newline at end of file +ARG MAXMIND_LICENSE_KEY + +RUN apt-get update \ + && apt-get install --no-install-recommends \ + ca-certificates \ + wget \ + unzip \ + # install ip4r + postgresql-12-ip4r -y \ + # download and unzip maxmind DB's + && cd /tmp \ + && wget -nv -O GeoLite2-City-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City-CSV&license_key=${MAXMIND_LICENSE_KEY}&suffix=zip" \ + && wget -nv -O GeoLite2-ASN-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&license_key=${MAXMIND_LICENSE_KEY}&suffix=zip" \ + && unzip GeoLite2-City-CSV.zip \ + && unzip GeoLite2-ASN-CSV.zip \ + && cd /tmp/GeoLite2-City-CSV_* && mv * .. \ + && cd /tmp/GeoLite2-ASN-CSV_* && mv * .. \ + && cd .. \ + && rm -rf /tmp/GeoLite2-ASN-CSV* \ + && rm -rf /tmp/GeoLite2-City-CSV* \ + && rm *.txt && ls -alh \ + && rm -rf /var/lib/apt/lists/* /var/tmp/* \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..27474b1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +The PostgreSQL License + +Copyright (c) 2022, Lotus Labs Ltd + +Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. + +IN NO EVENT SHALL Lotus Labs Ltd BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF Lotus Labs Ltd HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Lotus Labs Ltd SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND Lotus Labs Ltd HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1d76b6b --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Postgres Docker Image + +Unmodified Postgres with some useful plugins. Provides required extensions for use within our stack. + +## Features + +- ✅ [IP4R](https://github.com/RhodiumToad/ip4r). A PostgreSQL extension supporting 6 data types allowing you to store IPv4 & IPv6 addresses in a PostgreSQL table. +- ✅ [Maxmind GeoLite2 DB](https://dev.maxmind.com/geoip/geoip2/geolite2/). Maxmind's GeoLite2 City and ASN databases in CSV format ( available in the home (`~/`) directory ). + + +# Supported tags + +- `11`, `12`, `13`, `latest (13)` + +# Quick reference + +- **Where to get help**: + [the Docker Community Forums](https://forums.docker.com/), [the Docker Community Slack](https://blog.docker.com/2016/11/introducing-docker-community-directory-docker-community-slack/), or [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=docker) + +- **Where to file issues**: + [https://github.com/graphip/postgres-ip4r/issues](https://github.com/graphip/postgres/issues) + +- **Maintained by**: + [Colin Wilson](https://github.com/colinwilson) \ No newline at end of file