Skip to content

Create official docker images as part of release cycle #537

@beargiles

Description

@beargiles

The releases should include official docker images as part of the release cycle.

There are several reasons:

  • people regularly ask for them

  • people will write their own, encounter problems, and ask questions that are difficult to answer without having a copy of the docker image. (And maybe hard to answer even if you have the docker image)

  • people have been asking about nontrivial examples of the java application using and testing their server-side code.

The last item can be handled via a simple Spring Boot application that uses TestContainers to load an existing docker image. This requires an IDE that supports container-based testing or a docker instance . I'll defer discussion of this until later.

Current work

I had a github project with actions that would poll the official PostgreSQL repo and build new images after a release but it had two limitations since it was implemented in github actions using nothing but ansible. The first was that there was usually a lag between when the official database was release and when the official extensions were released. That confused my simple scripts. The second was that it requires a fair amount of work to extract the pljava version from the repo's package and I had a stop-gap manual method that wasn't sustainable.

That said...

I still have a multistage Dockerfile that can create clean docker images containing a preconfigured pl/java extension. It's ready to go - no need to execute CREATE EXTENSION pljava etc since it's done as part of the container's initialization.

For now we can use my existing Dockerfile, with a few tweaks for running in your environment, and possibly some github actions if you want the builds to be performed there. That has benefits since you can use CI/CD tools in that environment (e.g., for checking for known vulnerabilities) but there will still need to be a local build if a local container is required for the Spring Boot/Test Containers module mentioned above.

This Dockerfile may be split in the future since it starts by building a PGXN docker image and then extending that with the PL/Java docker image. I want to contribute that to the respective project but will probably keep it here because of the use of the official PostgreSQL docker image.

I'll add the current Dockerfile as a comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions