Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can all current builds be made to support both ARM64 and x86 architectures? #46

Closed
FreemanKevin opened this issue Aug 2, 2024 · 0 comments

Comments

@FreemanKevin
Copy link

Can all current builds be made to support both ARM64 and x86 architectures?

like this?

FROM arm64v8/tomcat:9-jre17

LABEL maintainer="Oscar Fonts <[email protected]>"

ENV GEOSERVER_VERSION 2.25.3
ENV GEOSERVER_DATA_DIR /var/local/geoserver
ENV GEOSERVER_INSTALL_DIR /usr/local/geoserver
ENV GEOSERVER_EXT_DIR /var/local/geoserver-exts

ENV GEOSERVER_PATH=/geoserver

# Microsoft fonts
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
RUN set -x \
	&& apt-get update \
	&& apt-get install -yq ttf-mscorefonts-installer unzip \
	&& rm -rf /var/lib/apt/lists/*

# GeoServer
RUN mkdir -p /usr/local/tomcat/conf/Catalina/localhost/ && \
    echo "<Context path=\"${GEOSERVER_PATH}\" docBase=\"/usr/local/geoserver\"></Context>" > /usr/local/tomcat/conf/Catalina/localhost/geoserver.xml
RUN mkdir ${GEOSERVER_DATA_DIR} \
    && mkdir ${GEOSERVER_INSTALL_DIR} \
	&& cd ${GEOSERVER_INSTALL_DIR} \
	&& wget http://sourceforge.net/projects/geoserver/files/GeoServer/${GEOSERVER_VERSION}/geoserver-${GEOSERVER_VERSION}-war.zip \
	&& unzip geoserver-${GEOSERVER_VERSION}-war.zip \
	&& unzip geoserver.war \
    && mv data/* ${GEOSERVER_DATA_DIR} \
	&& rm -rf geoserver-${GEOSERVER_VERSION}-war.zip geoserver.war target *.txt

# Tomcat environment
ENV CATALINA_OPTS "-server -Djava.awt.headless=true \
	-Xms128m -Xmx1560m -XX:NewSize=48m \
	-DGEOSERVER_DATA_DIR=${GEOSERVER_DATA_DIR}"

# Create tomcat user to avoid root access. 
RUN addgroup --gid 1099 tomcat && useradd -m -u 1099 -g tomcat tomcat \
    && chown -R tomcat:tomcat . \
    && chown -R tomcat:tomcat ${GEOSERVER_DATA_DIR} \
    && chown -R tomcat:tomcat ${GEOSERVER_INSTALL_DIR}

# index.html is used for health check; ensure build fails early if not present
RUN cat ${GEOSERVER_INSTALL_DIR}/index.html

ADD start.sh /usr/local/bin/start.sh
ENTRYPOINT [ "/bin/sh", "/usr/local/bin/start.sh"]

VOLUME ["${GEOSERVER_DATA_DIR}", "${GEOSERVER_EXT_DIR}"]

EXPOSE 8080

HEALTHCHECK --start-period=10s --interval=10s --timeout=5s --retries=50 \
    CMD curl -f "http://localhost:8080${GEOSERVER_PATH}/index.html" || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant