We are struggling with a common problem of trying to provide an Oracle 11g instance for our developers to test with. Our standard build agents are based on Ubuntu 12.04 but Oracle supports only RedHat based OS's.
There are some hacks about installing Oracle on Ubuntu floating around the net but they seem to be very fragile and a matter of hit-and-miss.
We want to avoid having to support an entire build server Puppet configuration on top of RedHat(/CentOS) just in order to support Oracle so I was beginning to wonder whether we can employ Docker to provide a RedHat-like environment required just for Oracle on top of our standard Ubuntu systems. The idea is that Oracle will run in its own container but the rest of the build agent will still run on standard Ubuntu, able to talk to Oracle over TCP.
I know what LXC's are and the difference between them and full-fledged virtualization like KVM/VirtualBox etc, but I was wondering whether it could still be possible.
Change [ "$1" != "1" ] to [ "$1" != "install" ] at the beginning of preinst.
Change [ "$1" = "1" -o -z "$2" ] to [ "$1" = "configure" -a -z "$2" ] at the beginning of postint.
Change [ "$1" = "0" ] to [ "$1" = "remove" -o "$1" = "purge" ] in prerm & postrm.
Change 'chkconfig' to 'update-rc.d' command in postinst & prerm.
In init script: remove absolute path of some system commands; fix /etc/sysconfig/oracle-xe to /etc/default/oracle-xe; fix /var/lock/subsys to /var/lock; and so on...
Add dependencies to control file: bc & libaio1.
Build the deb package using deb command.
Now you have a deb package of Oracle XE 11g. Install it!
But there's still a problem: /dev/shm. Here how to fix it:
Comment the line in /etc/init/mounted-dev.conf: [ -e /dev/shm ] || ln -s /run/shm /dev/shm.
Add a line in /etc/fstab: shm /dev/shm tmpfs size=2g 0 0
I can confirm that Oracle XE works within Docker.
the only issue is that inside the container the shm is configured to only 65356k
see
https://github.com/dotcloud/docker/issues/2606
The only workaround so far is to change the lxc template and recompile docker (which is easy)
This is definitely a feasible approach. We use Ubuntu 14.04 for our host machines and run several Oracle 11g instances within Docker containers for development purposes as well.
Currently (Docker 1.5) for both 11g and 12c the main issue is Docker's hard-coded shared memory limit Issue #2606. There are currently two workarounds for this:
Use docker run --privileged ... and remount /dev/shm with more memory before starting the instance
Oracle RDMS is a monster… It’s NOT meant to be a simple, install this here and use at will database. It is intense and oracle wants you know that. If your developers are truly tied to ubuntu, I would try to reevaluate your need for Oracle 11g (If you dont need an enterprise distro you probably dont need an enterprise RDMS). It sounds an awful lot like you are employing KISS with the build agent and forgetting about absolutely everything else.
@Sirex I’d be interested to hear what issues you had with it. I’ve been beta testing docker with several parts of our SaaS product, and haven’t run into a single issue yet.
@EEAA, browsing around their github issues when people were asking for the (elephant in the room) RHEL support and seeing how there were comments considering a needed move away from aufs due to ubuntu ditching it. The consensus was to move to btrfs which isn’t out of tech preview until RHEL7. There were also some pretty caviler attitudes to putting 3.10+ custom kernels onto RHEL boxes to make docker go. Overall i really liked the concept, but i think it’ll be some time before i’d be happy to roll it out. Only a quick cursory glance though, so YMMV.
To clarify - I’m in the build engineering business of a pure software company. This isn’t for internal consumption but for verifying that our web applications can talk to Oracle. We use Oracle Express for that and don’t need Oracle’s support.