Docker Glassfish 2.1.1
First, finding this version was already hard! The oldest release on the official repo is 3.0. Thanks to @d10xa and his repo I was able to find a download link. Second, due to some JDK version problems, I had to manually install a specific JDK version (
6u31) from Oracle's binary.
The good news is that since Glassfish comes with an old Apache Ant version, we avoid installing a newer version of Ant that would require Java 7 or 8. Moreover, we avoid any possible compatability problems with legacy code.
Binaries for JDK and Glassfish are downloaded from 3rd-party websites. This includes an external FTP that has the correct JDK version that Glassfish 2.1.1 needs. Even though its MD5-checked, if you prefer, download the binaries from Oracle's website (registration needed) and modify the Dockerfile accordingly.
There's two key environment variables set up:
$GLASSFISH_HOMEpoints to the Glassfish install directory
$GLASSFISH_CLASSPATHpoints to all the Java libs that Glassfish comes with. You can use it to run your applications like so:
java -cp $GLASSFISH_CLASSPATH:app.jar foo.bar.App
As usual in Glassfish you can visit its homepage at
localhost:8181. You also have its admin panel at
localhost:4848 with username
admin and password
adminadmin. Other ports are also exposed in case you need them.
If you are not familiar with Docker, or just forget the commands all the time like me, here is a resumé:
# run linking to the admin panel and main page docker run --rm -p 4848:4848 -p 8080:800 -ti jfloff/glassfish-2.1.1:latest # Use as base in another Dockerfile FROM jfloff/glassfish-2.1.1:6 # build from this repo's Dockerfile docker build --rm -t jfloff/glassfish-2.1.1:dev .
Feel free to contribute to this repo in any way you find fit.
The code in this repository, unless otherwise noted, is MIT licensed. See the
LICENSE file in this repository.