mirror of https://github.com/postgres/postgres
Add docker image build (#28)
Build docker image on top of `postgres:16` and push it to DockerHub on merge to the main branch. Also fixed linking issue in Makefilepull/209/head
parent
9b41a2f24c
commit
482f67f18a
@ -0,0 +1,25 @@ |
||||
name: Build and Push Docker Image |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- main |
||||
|
||||
jobs: |
||||
build-and-push: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout code |
||||
uses: actions/checkout@v2 |
||||
|
||||
- name: Login to Docker Hub |
||||
uses: docker/login-action@v1 |
||||
with: |
||||
username: ${{ secrets.DOCKERHUB_USERNAME }} |
||||
password: ${{ secrets.DOCKERHUB_TOKEN }} |
||||
|
||||
- name: Build and push Docker image |
||||
run: | |
||||
docker build -t perconalab/postgres-tde-ext:${{ github.sha }} -t perconalab/postgres-tde-ext:latest . -f docker/Dockerfile |
||||
docker push -a perconalab/postgres-tde-ext |
@ -0,0 +1,28 @@ |
||||
FROM postgres:16 |
||||
|
||||
RUN apt-get update; \ |
||||
apt-get install -y --no-install-recommends \ |
||||
curl \ |
||||
libjson-c-dev \ |
||||
libssl-dev \ |
||||
gcc \ |
||||
postgresql-server-dev-16 \ |
||||
make |
||||
|
||||
WORKDIR /opt/postgres-tde-ext |
||||
|
||||
COPY . . |
||||
|
||||
RUN make USE_PGXS=1 && \ |
||||
make USE_PGXS=1 install |
||||
RUN cp /usr/share/postgresql/postgresql.conf.sample /etc/postgresql/postgresql.conf; \ |
||||
echo "shared_preload_libraries = 'pg_tde'" >> /etc/postgresql/postgresql.conf; \ |
||||
echo "pg_tde.keyringConfigFile = '/etc/postgresql/tde_conf.json'" >> /etc/postgresql/postgresql.conf; \ |
||||
echo "{'provider': 'file','datafile': '/tmp/pgkeyring',}" > /etc/postgresql/tde_conf.json; \ |
||||
chown postgres /etc/postgresql/tde_conf.json; \ |
||||
mkdir -p /docker-entrypoint-initdb.d |
||||
COPY ./docker/pg-tde-create-ext.sql /docker-entrypoint-initdb.d/pg-tde-create-ext.sql |
||||
|
||||
VOLUME /etc/postgresql/ |
||||
|
||||
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"] |
@ -0,0 +1 @@ |
||||
CREATE EXTENSION pg_tde; |
Loading…
Reference in new issue