Apicurio on Podman

 Apicurio is the upstream project for Red Hat's Service Registry. Podman is also a Red Hat-developed tool. Given this connection, there's a natural synergy and a strong likelihood that Apicurio is tested and optimized for running on Podman.

 

 oc new-app postgresql-persistent \
  -p POSTGRESQL_USER=apicurio \
  -p POSTGRESQL_PASSWORD=apicurio \
  -p POSTGRESQL_DATABASE=registrydb

#create a network
podman network create apicurio-net

#run postgressql container and wait for it to start
podman run -d \
  --name apicurio-postgres \
  --network apicurio-net \
  -e POSTGRES_DB=apicurio-registry \
  -e POSTGRES_USER=apicurio-registry \
  -e POSTGRES_PASSWORD=password \
  -p 5432:5432 \
  postgres:15

#run apicurio container
podman run -it --rm \
  -p 8080:8080 \
  --network apicurio-net \
  -e APICURIO_STORAGE_KIND=sql \
  -e APICURIO_STORAGE_SQL_KIND=postgresql \
  -e APICURIO_DATASOURCE_URL=jdbc:postgresql://apicurio-postgres:5432/apicurio-registry \
  -e APICURIO_DATASOURCE_USERNAME=apicurio-registry \
  -e APICURIO_DATASOURCE_PASSWORD=password \
  apicurio/apicurio-registry:latest

#check containers
c46427cbd0f3  docker.io/library/postgres:15                                                                postgres              About a minute ago  Up About a minute           0.0.0.0:5432->5432/tcp                                                                                                                apicurio-postgres
f99f25070c7e  docker.io/apicurio/apicurio-registry:latest                                                  /opt/jboss/contai...  17 seconds ago      Up 18 seconds               0.0.0.0:8080->8080/tcp, 8443/tcp, 8778/tcp, 9779/tcp                                                                                  jolly_feynman

#What now?
#access to the UI
http://localhost:8080/
#list artifact
curl http://localhost:8080/apis/registry/v2/groups/default/artifacts
#upload an artifact
curl -X POST http://localhost:8080/apis/registry/v2/groups/default/artifacts \
     -H "Content-Type: application/json" \
     -H "X-Registry-ArtifactId: my-schema" \
     --data '{"type":"record","name":"Test","fields":[{"name":"f1","type":"string"}]}'
#check health status
curl http://localhost:8080/health
#retrieve artifact metadata
curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/my-schema/meta 


Comments