This guide uses Docker to run Eclipse GlassFish.
For Docker installation, see Docker.
Create a directory to store your configuration and compose files.
mkdir -p /opt/glassfish
cd /opt/glassfish
Create a Dockerfile and Compose definition for Eclipse GlassFish.
Create Dockerfile:
FROM eclipse-temurin:21-jre
ARG GLASSFISH_VERSION=8.0.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl unzip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL "https://download.eclipse.org/ee4j/glassfish/glassfish-${GLASSFISH_VERSION}.zip" -o /tmp/glassfish.zip \
&& unzip /tmp/glassfish.zip -d /opt \
&& mv /opt/glassfish8 /opt/glassfish \
&& rm -f /tmp/glassfish.zip
WORKDIR /opt/glassfish/glassfish/bin
EXPOSE 8080 4848
CMD ["./asadmin", "start-domain", "--verbose", "domain1"]
Create compose.yml:
services:
glassfish:
build:
context: .
ports:
- "8080:8080"
- "4848:4848"
Start the container in the background.
docker compose up -d
GLASSFISH_VERSION build arg to the latest stable release.Any questions?
Feel free to contact us. Find all contact information on our contact page.