oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.54k stars 5.42k forks source link

Create a minimal image with SQLPlus or sqlCl for initContainer use in Kubernetes #1568

Closed SierraNL closed 2 years ago

SierraNL commented 4 years ago

When you use Kubernetes as a platform you can use init containers to make sure your dependencies are in a correct state, before you start your application container.

If you use an external Oracle server or cluster, this is a way to create a user, grant permissions or maybe initialize, migrate or seed the database. So you need an image with a Oracle commandline client, either SqlPlus or sqlCl.

I've tried to do this, but there is not a ready to use image for this. I've used part of the instantclient dockerfile. But an init container should not have to install things. Besides that it should be as minimal as possible.

Djelibeybi commented 4 years ago

Can you be more specific about what's missing from the Instant Client image? It includes SQL*Plus by default.

SierraNL commented 4 years ago

The only instantclient on dockerhub is very old and not free: https://hub.docker.com/_/oracle-instant-client The dockerfile in this github repo seem good, although not optimized for size (compared to alpine I guess). With alpine-jre and sqlcl you could create a very minimal container, just for executing some sql statements at an external database.

Djelibeybi commented 4 years ago

We're not going to be releasing an Alpine-based image (for obvious and not-so-obvious legal/support reasons) but a SQLcl image might be a good addition. However, that's currently only available under the OTN license, which means you'd have to accept and download the tarball before creating the image.

I'll leave it up to @cjbj and @gvenzl to determine if this will be properly useful or not.

gvenzl commented 2 years ago

@cjbj is the right person when it comes to Instant Client and SQL*Plus.

cjbj commented 2 years ago

This is really a request to use Alpine, which isn't happening per @Djelibeybi

The existing Instant Client Dockerfile has SQL*Plus already and is only a few MB bigger than minimal. (It uses the Basic not Basic Light package).

sqlcl is now available without a clickthrough, and being more modern than SQL*Plus, would be a preferred direction.

Back to @gvenzl to decide about sqlcl.

gvenzl commented 2 years ago

A public SQLcl Docker image is available at https://container-registry.oracle.com/ You can pull it via docker pull container-registry.oracle.com/database/sqlcl:latest.

I believe all questions have been addressed, hence closing this ticket.