Oracle Instant Client downloads from Oracle's website require accepting license terms, which can cause Docker builds to fail when using direct wget downloads.
-
Download Oracle Instant Client manually:
- Visit: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
- Accept the license agreement
- Download:
instantclient-basic-linux.x64-21.1.0.0.0.zip
-
Place the file in your project root:
oracle-mcp/ ├── oracle-instantclient-basic-linux.x64-21.1.0.0.0.zip ├── Dockerfile └── ... -
Update Dockerfile to use COPY instead of wget:
# Copy Oracle Instant Client from build context COPY oracle-instantclient-basic-linux.x64-21.1.0.0.0.zip /tmp/ RUN mkdir -p /usr/lib/oracle && \ cd /usr/lib/oracle && \ unzip -q /tmp/oracle-instantclient-basic-linux.x64-21.1.0.0.0.zip && \ cd instantclient_21_1 && \ ln -s libclntsh.so.21.1 libclntsh.so && \ ln -s libocci.so.21.1 libocci.so && \ rm /tmp/oracle-instantclient-basic-linux.x64-21.1.0.0.0.zip
-
Add to .gitignore:
oracle-instantclient-*.zip
If Oracle provides official container images with Instant Client pre-installed, use those as a base:
FROM oraclelinux:8-slim
# Install Node.js and Oracle Client
# ... (check Oracle's documentation)Create a base image with Oracle Client pre-installed:
# Dockerfile.base
FROM node:20-slim
# Install Oracle Instant Client here
# Build: docker build -t node-oracle:20-slim -f Dockerfile.base .Then use it:
FROM node-oracle:20-slim
# Your application codeSome distributions provide Oracle Instant Client via package managers:
RUN apt-get update && \
apt-get install -y alien && \
wget https://download.oracle.com/otn_software/linux/instantclient/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm && \
alien -i oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpmIf your Oracle database is external and accessible, you might be able to:
- Install Oracle Instant Client on the host machine
- Mount it as a volume in Docker
- Or use a database proxy/gateway
The current Dockerfile attempts to download Oracle Instant Client with license acceptance headers. If this fails:
- Try the manual download method (Option 1) - Most reliable
- Check Oracle's download page - URLs may have changed
- Use a CI/CD pipeline - Download during build process with proper authentication
After setting up Oracle Client:
# Build the image
docker build -t mcp-oracle-server .
# Test Oracle Client installation
docker run --rm mcp-oracle-server \
sh -c "ls -la /usr/lib/oracle/instantclient_21_1/"
# Should show Oracle library filesFor production deployments:
- Use a pre-built base image with Oracle Client
- Use a secrets manager for Oracle credentials
- Use a managed Oracle database service (AWS RDS, Azure Database, etc.)
- Consider using Oracle's official container images if available