forked from fbascheper/JBoss-EAP-Docker-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·121 lines (89 loc) · 4.31 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#######################################################################
# Creates a base Centos 6.7 image with JBoss EAP-6.4.x #
#######################################################################
# Use the centos 6.7 base image
FROM centos:6.7
MAINTAINER fbascheper <[email protected]>
# Update the system
RUN yum -y update;yum clean all
##########################################################
# Install Java JDK
##########################################################
RUN yum -y install wget && \
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.rpm && \
echo "6c9adca7ba0f89fe755653d2a62cdbd3 jdk-8u60-linux-x64.rpm" >> MD5SUM && \
md5sum -c MD5SUM && \
rpm -Uvh jdk-8u60-linux-x64.rpm && \
yum -y remove wget && \
rm -f jdk-8u60-linux-x64.rpm MD5SUM
ENV JAVA_HOME /usr/java/jdk1.8.0_60
# Perform the "Yes, I want grownup encryption" Java ceremony
RUN mkdir -p /tmp/UnlimitedJCEPolicy
ADD ./jce-unlimited/US_export_policy.jar /tmp/UnlimitedJCEPolicy/US_export_policy.jar
ADD ./jce-unlimited/local_policy.jar /tmp/UnlimitedJCEPolicy/local_policy.jar
RUN mv /tmp/UnlimitedJCEPolicy/*.* $JAVA_HOME/jre/lib/security/
RUN rm -rf /tmp/UnlimitedJCEPolicy*
# Add CA certs
ADD ./trusted-root-ca/StaatderNederlandenRootCA-G2.pem /tmp/StaatderNederlandenRootCA-G2.pem
RUN $JAVA_HOME/bin/keytool -import -noprompt -trustcacerts -alias StaatderNederlandenRootCA-G2 -file /tmp/StaatderNederlandenRootCA-G2.pem -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit
##########################################################
# Create jboss user
##########################################################
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r jboss && useradd -r -g jboss -m -d /home/jboss jboss
############################################
# Install EAP 6.4.0.GA
############################################
RUN yum -y install zip unzip
USER jboss
ENV INSTALLDIR /home/jboss/EAP-6.4.0
ENV HOME /home/jboss
RUN mkdir $INSTALLDIR && \
mkdir $INSTALLDIR/distribution && \
mkdir $INSTALLDIR/resources
USER root
ADD distribution $INSTALLDIR/distribution
RUN chown -R jboss:jboss /home/jboss
RUN find /home/jboss -type d -execdir chmod 770 {} \;
RUN find /home/jboss -type f -execdir chmod 660 {} \;
USER jboss
RUN unzip $INSTALLDIR/distribution/jboss-eap-6.4.0.zip -d $INSTALLDIR
# Add patch - EAP 6.4.4
RUN $INSTALLDIR/jboss-eap-6.4/bin/jboss-cli.sh "patch apply $INSTALLDIR/distribution/jboss-eap-6.4.4-patch.zip"
############################################
# Create start script to run EAP instance
############################################
USER root
RUN yum -y install curl
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.3/gosu-amd64" \
&& chmod +x /usr/local/bin/gosu
############################################
# Remove install artifacts
############################################
RUN rm -rf $INSTALLDIR/distribution
RUN rm -rf $INSTALLDIR/resources
############################################
# Add customization sub-directories (for entrypoint)
############################################
ADD docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
RUN chown -R jboss:jboss /docker-entrypoint-initdb.d
RUN find /docker-entrypoint-initdb.d -type d -execdir chmod 770 {} \;
RUN find /docker-entrypoint-initdb.d -type f -execdir chmod 660 {} \;
ADD modules $INSTALLDIR/modules
RUN chown -R jboss:jboss $INSTALLDIR/modules
RUN find $INSTALLDIR/modules -type d -execdir chmod 770 {} \;
RUN find $INSTALLDIR/modules -type f -execdir chmod 660 {} \;
############################################
# Expose paths and start JBoss
############################################
EXPOSE 22 5455 9999 8009 8080 8443 3528 3529 7500 45700 7600 57600 5445 23364 5432 8090 4447 4712 4713 9990 8787
RUN mkdir /etc/jboss-as
RUN mkdir /var/log/jboss/
RUN chown jboss:jboss /var/log/jboss/
COPY docker-entrypoint.sh /
RUN chmod 700 /docker-entrypoint.sh
############################################
# Start JBoss in stand-alone mode
############################################
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["start-jboss"]