Skip to content
Ondro Mihályi edited this page Jan 26, 2025 · 15 revisions

Eclipse Glassfish Full Profile Docker Image

The Docker image is available at the following coordinates: ghcr.io/eclipse-ee4j/glassfish

More info about the image in the container registry: https://ghcr.io/eclipse-ee4j/glassfish

Images are available for the amd64 and arm64 architectures.

How to Use Eclipse GlassFish Docker Image?

Start GlassFish Server in Docker

docker run -p 8080:8080 -p 4848:4848 ghcr.io/eclipse-ee4j/glassfish

Open the following URLs in the browser:

For more info about using GlassFish Server in the Docker image, see Using GlassFish Server with the docker Command

Start GlassFish Embedded in Docker

To run an application in /applications/myapp.war with GlassFish Embedded:

docker run -p 8080:8080 -v /applications:/opt/glassfish7/apps ghcr.io/eclipse-ee4j/glassfish runembedded apps/myapp.war

Or to deploy all applications in the /applications directory:

docker run -p 8080:8080 -v /applications:/opt/glassfish7/autodeploy ghcr.io/eclipse-ee4j/glassfish runembedded

For more info about using GlassFish Embedded in the Docker image, see Using GlassFish Embedded with the docker Command

To deploy an app on GlassFish Server using the Test Containers framework

new GenericContainer<>("ghcr.io/eclipse-ee4j/glassfish:latest")
            .withExposedPorts(8080, 4848)
            .withCopyFileToContainer(MountableFile.forHostPath(applicationPath),
                "/opt/glassfish7/glassfish/domains/domain1/autodeploy/" + APP_FILENAME)
            .waitingFor(
                Wait.forLogMessage(".*Successfully autodeployed.*", 1)
                    .withStartupTimeout(Duration.ofSeconds(10L)))
            ;

Further information on using GlassFish in Docker

Jakarta EE resources

Where to Get Help?

What About GlassFish 6?

Eclipse GlassFish 6 contains many changes, however some of important start/stop issues were fixed with redesign and refactoring done for Eclipse GlassFish 7. Simply said, 6 is not ready for Docker.

Why Folder Per Version?

Repository contains copy-pastes. The reason is that Docker Hub Container Image Library uses just and only Dockerfiles from this repository, but before we push them out, we already have to know that they are correct and we have to commit them. DockerHub then links its distribution image to the commit id in this repository.

License

See https://www.eclipse.org/legal/epl-2.0/