Date:

Easily Run Oracle Database in Docker

Why Oracle Database?

Oracle is trusted for its reliability, scalability, and security. It supports:

  • Large-scale data processing
  • Advanced analytics
  • Integration with modern apps

Whether you’re learning SQL, testing your app, or exploring databases, Oracle is a great choice.

Prerequisites

  • Install Docker Desktop on your macOS. Follow Docker’s official guide if needed.
  • Sign up for a free Docker Hub account to access Oracle images.

Let’s Get Started

Step 1: Pull the Oracle Container Registry

  1. Create an Oracle account.
  2. Log in to Oracle Container Registry and search for Oracle Database XE.
  3. Accept the license terms.
  4. Log in with Docker.

Step 2: Create and Run a Container

  • Create a file named docker-compose.yml and add the following content:
    version: '3.8'
    services:
    oracle-db:
    image: container-registry.oracle.com/database/express:latest
    container_name: oracle-demo
    ports:
      - "1521:1521"
    environment:
      - ORACLE_PWD=YourPassword123
    volumes:
      - oracle-data:/opt/oracle/oradata
    volumes:
    oracle-data:
  • Scan your Docker image for vulnerabilities: trivy image container-registry.oracle.com/database/express:latest

Alternative Security Tools Ranking


  • Snyk: A developer-friendly tool to scan for vulnerabilities in Docker images and fix them.
  • Anchore: A detailed analysis tool that checks compliance and vulnerabilities.
  • Clair: A container vulnerability analysis service.
  • Dockle: A container linter that focuses on CIS Docker benchmarks.
  • Checkov: Ideal for scanning configuration files for security misconfigurations.

Step 4: Connect to the Database

  • Use SQL Developer or any SQL editor to connect:
    Host: localhost
    Port: 1521
    Username: system
    Password: YourPassword123
    SID: xe

    Once connected, you can start exploring Oracle SQL commands!

Conclusion

Running Oracle Database in Docker is simple and quick. It’s a fantastic way to:

  • Learn Oracle SQL.
  • Test applications locally.
  • Explore database management features.

Let’s Connect!

If you find this repository useful and want to see more content like this, follow me on LinkedIn to stay updated on more projects and resources!

Latest stories

Read More

LEAVE A REPLY

Please enter your comment!
Please enter your name here