-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile.dev
44 lines (26 loc) · 1.22 KB
/
Dockerfile.dev
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
# Use belaban/alpine (contains minimal alpine/openjdk and some packages)
FROM belaban/alpine
LABEL maintainer Bela Ban <[email protected]>
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN mkdir -p /opt/jgroups
RUN addgroup -S jgroups -g 1000
RUN adduser -u 1000 -S -G jgroups -h /opt/jgroups -s /sbin/nologin 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 JAVA_HOME /usr/lib/jvm/java
ENV PATH $PATH:$HOME/jgroups-docker/bin
WORKDIR /opt/jgroups
## Download JGroups src code and build JAR
RUN git clone https://github.com/belaban/jgroups-docker.git
RUN cd jgroups-docker && ant jar src.jar ## compiles and places JAR in ./dist
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 while true; do sleep 60; done