Coming out of DockerCon this year one of the announcements I was most excited about was from Oracle with their Docker support. I don’t know why I was excited about it as I haven’t used Oracle for a project in over 12 years, but odd things excite me. Since I have Docker for Windows running on my Windows 10 laptop, I decided I would use that to create an image of Oracle Database 126.96.36.199 Express Edition. I won’t rehash the steps here as the good folks at Oracle have done a decent job of this already, but I will call out a few things I noticed:
- Don’t un-compress the installation binaries after downloading. Yeah, I know they call that out in the docs, but I missed it initially.
- Be patient. Or multi-task.
- And most importantly, Express expects at least 2048MB swap space. The MobyLinuxVM used by Docker for Windows only has 1024MB. So you will get an error stating:
”This system does not meet the minimum requirements for swap space. Based on the amount of physical memory available on the system, Oracle Database 11g Express Edition requires 2048 MB of swap space. This system has 1023 MB of swap space. Configure more swap space on the system and retry the installation. “
So unless someone out there can tell me how to set up a larger swap space in that VM, we are stuck and can’t use Docker for Windows. Dammit. I did tag on to an existing Docker forum post, so we’ll see if that bears any fruit.
In the meantime, I fired up an Ubuntu image in Azure and installed Docker and used that to create the container. I didn’t create it with swap space so I did have to go in and add that (I used this method), but once that was setup the image was created just fine. Previous note applies regarding patience and/or multi-tasking.
Not the smallest of images, but there you have it. Now I can fire up an Express Database running in Docker by running:
docker run –name oracleexpress –shm-size=1g -p 1521:1521 -p 8080:8080 -e ORACLE_PWD=tmppassword oracle/database:188.8.131.52-xe
After about 5 minutes, you’ll have a running container! To test the connection and make sure it was running, I logged in using sqlplus from the container:
docker exec -ti oracleexpress sqlplus system/tmppassword@//localhost:1521/XE
Connection successful, and I was able to query the database!
Here’s the image up on Docker Hub if you just want to pull it and start playing.
Now to figure out that MobyLinuxVM swap space…
P.S. If there was any doubt it would run on Windows 10, here it is running on my Windows machine after pulling the image down from Docker Hub (click the image for full screen):