-
Notifications
You must be signed in to change notification settings - Fork 477
/
Dockerfile
52 lines (37 loc) · 1.68 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## 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 adoptopenjdk/openjdk11:jre as build-stage
RUN apt-get update ; apt-get install -y git ant net-tools netcat iputils-ping
# For the runtime, we only need a JRE (smaller footprint)
FROM adoptopenjdk/openjdk11:jre as make-dirs
LABEL maintainer="Bela Ban ([email protected])"
RUN useradd --uid 1000 --home /opt/jgroups --create-home --shell /bin/bash jgroups
RUN echo root:root | chpasswd ; echo jgroups:jgroups | chpasswd
RUN 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