HUB
Sign inSign up

drazev/cuoracledevdbms

By drazev

•Updated over 2 years ago

This is a repository for the CU Dev container with Oracle DBMS.

Image
0

80

drazev/cuoracledevdbms repository overview

⁠Jayson's Carleton University Developer DBMS (cuoracledevdbms)

Docker Hub Link⁠

IMPORTANT This version of the image is NOT suitable for creating secured database servers! Use the official image because it is more secure.

This is a docker image created for students at Carleton University. It was made so that students could get running quickly with minimal knowledge regardless of operation systems and without needing to use virtual machine software.

⁠Features

This container upgrades an official Oracle DBMS docker container with the following:

  • password is automatically set to "oracle" by default
  • SSH is installed and setup for external connections
  • A volume was setup so that the database instance has persistent data
  • A development environment was setup to develop in Pro*C, C++, Java, etc (Installed Development Tools package)
  • GIT has been installed so that you can develop in the container and pull or push to your repoistory

⁠Getting Started

Docker containers are a useful way to create disposable instances quickly for development, testing, or production environments. They are similar to virtual machines in that they create an environment for you to build and test applications.

However, there are key differences between containers and virtual machines and if you would like to learn more about them this site is a useful resource. Read: What’s the Diff: VMs vs. Containers⁠ for more information.

⁠Key things you should know about Containers vs Virtual Machine
  • When you delete the docker container, any information in that container will be lost. This includes any volumes automatically generated by the image which are not mapped by the user.
  • User-defined volumes persist and can be mapped to one or more instances (This is when YOU create a container and map a volume from some location on the host to a location in the container)
  • Containers SHARE a kernel and use isolation to make each container independent of each other.
  • This means that containers don't actually initialize the same way so any configuration changes that occur at startup will not work. So some changes to /etc/* configurations that depend on the startup process will not work.
  • SYSTEMD is not running in containers.
  • Normal automounting from /etc/fstab will not work since the container OS doesn't have a normal startup.
⁠Prerequisites
  • Docker or Docker Desktop installed
  • Internet Connection (For initial image download only)
⁠Usage
  1. PULL the image drazev/cuoracledevdbms:1.0.2 from docker hub to download it to your computer. This makes it available to create containers where 1.0.2 is the version. (NOTE: Running a container you don't have automatically will do this step)
  2. RUN the image and customize it in one of two ways.

NOTE Default options will choose a random name for the container and will isolate it completely from the host machine. Data will persist inside the container until you destroy it. To change this behaviour, you must customize the container options!

⁠Container Options to Consider
  • If you want to save database data between images, you need to map a volume using a host location to /opt/oracle/oradata. If you don't the data will be destroyed when you delete the container.
  • Set up the container database for connections outside the container by choosing a port to map to 1521 when prompted in the options. You can have docker assign a random port on EVERY reboot by entering port 0 on your host machine.
  • Allow SSH into the container by choosing a port to map to 22 when prompted in options. You can have docker assign a random port on EVERY reboot by entering port 0 on your host machine.
⁠Environment Variables
  • ORACLE_DB_DATA_PATH The path of the oracle database data folder. This is default /opt/oracle/oradata
  • START_SSHD A true or false value that determines if SSHD will be run on container startup and allow ssh connections. Default: true
  • ORACLE_PWD The default password assigned to the database and Linux user when the container was created. This could have been changed afterwards.
⁠Volumes
  • /opt/oracle/oradata This is the location where the oracle database data files are stored.

NOTE You can bind map a host location to this location within the container. This will have docker bind your host location instead of creating a volume. If you map your own host location to this volume you can keep the database data backed up and use sit with another image. Beware that it is not intended to be shared by multiple DBMS. So you will have undefined results if more than one Oracle DBMS uses it!

⁠Advanced Customization
⁠Running Scripts after Setup or Startup

See: Running Scripts after Setup or Startup in official base image documentation⁠

⁠Moving Files between Host and Container

You can move files between the host and container in one of two ways.

  1. Use a program like scp, ssh, or even a code editor like VS Code to copy files
  2. You can map a folder from your host machine as a volume into a location within the container. This will make those files available. E.g. You might map c:\myfolder to /home/oracle/myfolder

⁠Connecting to your Database

  1. Make sure the container is running.
  2. Look at the port that has been assigned to 1521. You can do this in docker desktop by viewing container details, or in docker console by doing docker ps
  3. In your application the following details to setup your connection string.
{
    SID = FREE
    USER = system
    PASSWORD: oracle
    URL: localhost:<yourContainerPort>
}

⁠Built With

This image is derived from the official Oracle Docker container running the latest free version. Docker Base Image tag: container-registry.oracle.com/database/free: latest Official Oracle Documentation: https://container-registry.oracle.com/ords/ocr/ba/database/free⁠

⁠Find Us

⁠Contributing

⁠Project Repo

⁠Versioning

⁠Authors

⁠License

Oracle Free Use Terms and Conditions⁠

⁠Acknowledgments

  • Thank you to the COMP4003 Class of Winter 2024 for helping me test this image.

Tag summary

Content type

Image

Digest

sha256:a9d7f9864…

Size

3.6 GB

Last updated

over 2 years ago

docker pull drazev/cuoracledevdbms:1.0.2