One of the things that kept me busy lately was experimenting with how much an Oracle XE database setup could be streamlined inside a Docker image for things like CI/CD consumption. Pretty much ever since I put together the first official build scripts for Oracle Database, people have asked for faster image pull and startup times to speed up their continuous integration tests. A lot of things have changed since then, and I’m happy that my engineering colleagues at Oracle have taken on the maintenance and further enhancements of Oracle’s official Docker build files and images, and integrated them into the internal processes.Continue reading “Introducing gvenzl/oracle-xe: Oracle Database XE Docker images”
Docker has become widely popular in the last couple of years. I use it on a regular basis these days for running Oracle databases on my laptop. Docker is available on all popular Linux distributions, as well as Mac and Windows, and of course Oracle Linux is no exception. Since a long time Docker ships with the Oracle Linux 7 addons yum repository. Having setup Docker on Oracle Linux numerous times, I thought it would be good for me to document my steps for others to follow.
- Update Oracle Linux and UEK to the latest version (OL 7 and UEK5):
- Install yum-config-manager, if not already installed:
yum install yum-utils
- Enable the addons yum repo:
yum-config-manager --enable *addons
- Install docker-engine:
yum install docker-engine
Oracle has added Oracle REST Data Services (ORDS) to the Docker build files family on GitHub, which means that you can now easily dockerize ORDS. If you don’t know yet what ORDS is, it’s a free technology from Oracle that allows you to REST-enable your Oracle databases. More specifically, with ORDS you can just fire off regular REST calls to modify or retrieve data from one or many Oracle databases without having to know how to write SQL; not that knowing SQL is a bad thing! 🙂 In modern application and microservices architectures REST has become more and more popular for exchanging information. ORDS enables you to easily exchange data from and to Oracle databases via REST without having to write lines and lines of code yourself. For more information on what ORDS is and what it can do, check out Jeff Smith’s blog post about ORDS.
When it comes to space efficiency Docker still isn’t quite as good as it could be. The layered filesystem used by Docker sometimes occupies more space than is really necessary. Over time, a couple of enhancements have made their way into Docker to allow the build of more space efficient images. The
ADD instruction for example is smart enough to detect (unfortunately only) local compressed archives (and unfortunately only
xz but not
zip archives) and directly adds the uncompressed contents into the image, unlike the
COPY instruction that simply copies a file into the image. The downside of the latter is that space is occupied for the zip archive itself and the extracted contents of the archive, whereas the former will not occupy any space for the archive as it is never added into the image.
Oracle has released Docker build files for the Oracle Database on Github. With those build files one can go ahead and build his or her own Docker image for the Oracle Database. If you don’t know what Docker is you should go and check it out. It’s a cool technology based on the Linux containers technology that allows you to containerize your application, whatever that application may be. Naturally, it didn’t take long for people to start looking at containerizing databases as well which makes a lot of sense, especially for, but not only, development and test environments. Here is a detailed blog post on how to containerize your Oracle Database by using those build files that Oracle has provided.