## Builds an image containing JGroups. ## ********************************************************** ## Make sure you have JGroups compiled (ant) before doing so! ## ********************************************************** # Build: docker build -f Dockerfile -t belaban/jgrp . # Push: docker push belaban/jgrp # Multi-arch images with podman: # First, initialise the manifest # (optionally) podman manifest remove belaban/jgrp # podman manifest create belaban/jgrp # Build the image attaching them to the manifest # podman build --platform linux/amd64,linux/arm64 --manifest belaban/jgrp . # Finally publish the manifest # podman manifest push belaban/jgrp FROM eclipse-temurin:17-jre as build-stage RUN apt-get update && \ apt-get install -y git ant net-tools netcat-traditional iputils-ping # For the runtime, we only need a JRE (smaller footprint) FROM eclipse-temurin:17-jre as make-dirs LABEL maintainer="Bela Ban ([email protected])" RUN useradd --uid 1001 --home /opt/jgroups --create-home --shell /bin/bash jgroups && \ echo root:root | chpasswd && \ echo jgroups:jgroups | chpasswd && \ printf "\njgroups ALL=(ALL) NOPASSWD: ALL\n" >> /etc/sudoers # EXPOSE 7800-7900:7800-7900 9000-9100:9000-9100 ENV HOME /opt/jgroups ENV PATH $PATH:$HOME/JGroups/bin ENV JGROUPS_HOME=$HOME/JGroups WORKDIR /opt/jgroups COPY --from=build-stage /bin/ping /bin/netstat /bin/nc /bin/ COPY --from=build-stage /sbin/ifconfig /sbin/ COPY ./classes $JGROUPS_HOME/classes COPY ./lib $JGROUPS_HOME/lib COPY ./bin $JGROUPS_HOME/bin RUN chown -R jgroups:jgroups $HOME/* # Run everything below as the jgroups user. Unfortunately, USER is only observed by RUN, *not* by ADD or COPY !! USER jgroups RUN chmod u+x $HOME/* CMD /bin/bash