Installing Oracle XE with Docker
Nicest way to install Oracle XE on any operating system (for development) is Docker. Docker is an application container for Mac, Linux and Windows. It is based on LXC and gives you the ability to package complete application including their dependencies to a self-containing file (called an image). These images can be exchanged and run on every Linux machine where Docker is installed! Awesome!
Docker images are also shared around the community on index.docker.io. And this is where this two guys come into play:
- Wei-Ming Wu made a Docker image containing Oracle XE. You can find it here.
- Alexei Ledenev extended Wei-Ming Wu’s image to also use the Oracle web console (APEX). You can find it here
Both projects work the same:
- Install Docker on your machine. You can find instructions for that at docs.docker.com/docker-for-mac. (For other operating systems please see Docker’s official website)
- Pull the image to your machine:
docker pull alexeiled/docker-oracle-xe-11g
Run the image:
docker run -d --shm-size=1g -p 8080:8080 -p 1521:1521 -v /local-initdb:/etc/entrypoint-initdb.d alexeiled/docker-oracle-xe-11g
- That’s it. Absolutely simple.
Additionally, if you want to ssh
to your docker container, you can run following commands:
To get container_id
:
docker ps
SSH into your container:
docker exec -i -t [container_id] /bin/bash
The great thing is that those images are not as big as a virtual machine. They only contain the actual application and its environment. But they are packed in a way that they can be executed everywhere right out of the box but are still isolated. You can also make changes to the images and create another image containing your changed system.