Skip to content

Commit

Permalink
Build docker image from bookworm so arm64 builds are available for an…
Browse files Browse the repository at this point in the history
…y version
  • Loading branch information
Gael Abadin committed Feb 7, 2024
1 parent c037b7d commit 7bcb0c6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 13 deletions.
23 changes: 16 additions & 7 deletions hello-payara-world-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,22 @@
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.0</version>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/target/test-classes/dockerfiles</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>fish.payara.distributions</groupId>
<artifactId>payara</artifactId>
<version>${payara.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/target/test-classes/dockerfiles</outputDirectory>
<destFileName>payara.zip</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.0</version>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/target/test-classes/dockerfiles</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
if [ -f /tmp/firstrun ]; then
echo "deploy /opt/payara/hello.ear" >> "first_run_post_boot_commands"
echo "deploy /opt/payara6/hello.ear" >> "first_run_post_boot_commands"
asadmin start-domain -v --postbootcommandfile=first_run_post_boot_commands
rm /tmp/firstrun
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
FROM payara/server-full:${payara.version}-jdk17
FROM debian:bookworm

# Ports being exposed
EXPOSE 8080
EXPOSE 8181

USER root

RUN apt update && \
apt -y upgrade && \
apt -y install wget unzip less openjdk-17-jre-headless

ENV PAYARA_VERSION=${payara.version}

ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

# Set environment variables for payara
ENV PAYARA_HOME=/opt/payara6

COPY payara.zip .
RUN unzip -o payara.zip -d /opt && \
rm -f payara.zip

# Setup payara
RUN mkdir $PAYARA_HOME/.iddocserver &&\
useradd -d $PAYARA_HOME payara && \
chown -R payara:payara /opt

ENV PATH=$PATH:$PAYARA_HOME/bin

# Set payara admin password
ENV PAYARA_PASSWORD=changeme
USER root
ENV MEM_MAX_RAM_PERCENTAGE=80
ENV MEM_XSS=1024k
RUN echo "AS_ADMIN_PASSWORD=${PAYARA_PASSWORD}" > /tmp/glassfishpwd
RUN chown -R payara:payara /opt
RUN chown -R payara:payara /tmp/glassfishpwd
Expand All @@ -19,8 +43,9 @@ RUN touch /tmp/firstrun && chown payara:payara /tmp/firstrun
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER payara
COPY domain.xml /opt/payara/appserver/glassfish/domains/domain1/config/
COPY *.jar /opt/payara/appserver/glassfish/domains/domain1/lib/
COPY hello.ear /opt/payara/hello.ear
WORKDIR $PAYARA_HOME
COPY domain.xml $PAYARA_HOME/glassfish/domains/domain1/config/
COPY *.jar $PAYARA_HOME/glassfish/domains/domain1/lib/
COPY hello.ear $PAYARA_HOME/hello.ear

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 7bcb0c6

Please sign in to comment.