Containerized Oracle XE 11g
Why one more Docker image for Oracle XE?
The main reason for this repo is to have clean and transparent Dockerfile, without any magic behind.
It is based on official CentOS images and the build is completely described in the Dockerfile.
Unlike many other images on the Net this one uses stock rpm installer provided by Oracle, not repacked by
How to build
Let's assume that you are familar with Docker and building Docker images from Dockerfiles.
Download the rpm installer.
Unzip it and pack
oracle-xe-11.2.0-1.0.x86_64.rpm.tar.gzso that it's contents look like:
% tar -tf oracle-xe-11.2.0-1.0.x86_64.rpm.tar.gz oracle-xe-11.2.0-1.0.x86_64.rpm
Place the tarball inside the
rpmdirectory of this repo.
docker build -t "madhead/docker-oracle-xe" .from the root directory of this repo.
You should get your image ready in a few minutes (apart from downloading base
During the configuration of Oracle XE instance two files -
initXETemp.ora - are overridden with ones from
config directory of this repo.
The only difference is that
memory_target parameter is commented in them to prevent
ORA-00845: MEMORY_TARGET not supported on this system error.
The only piece of magic in this image :).
Building on boot2docker & Docker Machine
Thanks @pmelopereira for the instructions!
The steps are same as for usual build, but you need to configure swap space in boot2docker / Docker Machine prior the build:
Log into boot2docker / Docker Machine:
docker-machine ssh default(replace
Create a file named
/var/lib/boot2docker/with the following content:
#!/bin/sh SWAPFILE=/mnt/sda1/swapfile dd if=/dev/zero of=$SWAPFILE bs=1024 count=2097152 mkswap $SWAPFILE && chmod 600 $SWAPFILE && swapon $SWAPFILE
Make this file executable:
chmod u+x /var/lib/boot2docker/bootlocal.sh
After restarting boot2docker / Docker Machine, it will have increased swap size. Just follow the steps above to build this image.
How to use
docker run -p 8089:8080 -p 1521:1521 -d madhead/docker-oracle-xe will start new container and bind it's local ports
8080 to host's
Read Docker documentation for details.
Oracle Web Management Console (apex) will be available at http://localhost:8089/apex. Use the following credentials to login:
workspace: INTERNAL user: ADMIN password: oracle
Connect to the database using the following details:
hostname: localhost port: 1521 sid: XE username: system password: oracle
To build and use this image your host machine need to have at least 2GB of swap.
This is an Oracle XE limitation, described here.
It is not possible to use
swapon command from inside the container to increase swap space due to security reasons.
If you know how to bypass this, please share the knowledge with me.