diff --git a/.travis.yml b/.travis.yml index 70ae6c9..8056ff3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ env: - DOCKER_IMAGE_NAME=jboss-eap-7.3 - secure: "Yas+0gZOHWZYIn4ce062J2SVW8/SJsWc8uggE7EGF73qp9qP2JZXy1U77Wn6FiNYYwNzmbdcYVt0L4+mzc/tSAGnl6U7YvYGSmBFmNz84DalOxGebGHVWLNiQKNMshNa5HwUcm+J1rPB7Hu9Xn41MfWZIM0duCNx92+WkYPz3ea2A5MNhk3GTAnsf23vtdXnGJw1U8a5Ibcmf80DI2H2tMFUKJ97XAtFCkBtBiWq29AVPSkMMVbNv3DZWC4zl7fKuuMKZDyQyfMSpROxsEv66+Z5BYYUSqG9m0Lqcsg7FWfMK4gHsxbD1IdPyPq15ymclBNQTQbKjfEJGFZO0zPnXihxYXfA0r+pkcnkVAKrxopp3vcFW9fuZI4RJ5B5d+5ZUmDp0kzthzPXcVXOh8aXq7YBp8a6uxC/0M6bfvgYFfeXGxgH2Im+M5SXBiKJACgDjOIbN5Szb5XckQHmxZkzAt9Lm2XnXDhxbpgHeE4kXgEQILFXw7tIMJDozXClyoOffVzJrGmqmx9+qZde7FaTjWaD4yQUkDqslRlkJWKc1noibG0KbsLRY3HaXv+A3qctIAI1NNJK26FHi/IgwvNzS2P+bD+LCMdAxat4CKEC0SyRzjAyHEffDkLv8HrDUf4HkW2/sejNe0nAAdUft9Fg+Q+0t4SASsdEBfZGKTW8Fos=" install: true -if: tag ~= alpine$ OR tag ~= centos$ OR branch == master +if: tag ~= debian$ OR tag ~= alpine$ OR tag ~= centos$ OR branch == master script: - docker system prune -af --volumes - docker build -t ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME} . diff --git a/Dockerfile b/Dockerfile index c91915f..157d7f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,46 @@ -FROM centos:centos8.1.1911 +FROM openjdk:11.0.7-jdk-slim-buster LABEL MAINTAINER="Maksim Kostromin " -ENV PRODUCT="jboss-eap-7.3" \ +ENV PRODUCT="jboss-eap-7.3" \ JBOSS_USER="jboss" -ENV ADMIN_USER="admin" \ - ADMIN_PASSWORD="Admin.123" \ - JBOSS_USER_HOME="/home/${JBOSS_USER}" \ - DOWNLOAD_BASE_URL="https://github.com/daggerok/${PRODUCT}/releases/download" \ +ENV ADMIN_USER="admin" \ + ADMIN_PASSWORD="Admin.123" \ + JBOSS_USER_HOME="/home/${JBOSS_USER}" \ + DOWNLOAD_BASE_URL="https://github.com/daggerok/${PRODUCT}/releases/download" \ JBOSS_EAP_PATCH="7.3.0" -ENV JBOSS_HOME="${JBOSS_USER_HOME}/${PRODUCT}" \ - ARCHIVES_BASE_URL="${DOWNLOAD_BASE_URL}/archives" \ +ENV JBOSS_HOME="${JBOSS_USER_HOME}/${PRODUCT}" \ + ARCHIVES_BASE_URL="${DOWNLOAD_BASE_URL}/archives" \ PATCHES_BASE_URL="${DOWNLOAD_BASE_URL}/${JBOSS_EAP_PATCH}" -ENV PATH="${JBOSS_HOME}/bin:/tmp:${PATH}" \ - JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" \ +ENV PATH="${JBOSS_HOME}/bin:/tmp:${PATH}" \ JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0" USER root -RUN yum update --security -y -q && \ - yum install -y -q unzip openssh-clients zip net-tools \ - wget ca-certificates curl sudo java-1.8.0-openjdk-devel && \ - echo "${JBOSS_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ - groupadd --system --gid 1001 ${JBOSS_USER} && \ - adduser --system -m -d ${JBOSS_USER_HOME} -s /sbin/bash -g ${JBOSS_USER} --uid 1001 ${JBOSS_USER} && \ - usermod -a -G ${JBOSS_USER} ${JBOSS_USER} +RUN ( apt-get update -y || echo "cannot update." ) && \ + apt-get install -y wget ca-certificates unzip sudo openssh-client net-tools && \ + echo "${JBOSS_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + sed -i "s/.*requiretty$/Defaults !requiretty/" /etc/sudoers && \ + addgroup --system --gid 1001 ${JBOSS_USER} && \ + adduser --system --home ${JBOSS_USER_HOME} --shell /bin/ash --gid 1001 --uid 1001 ${JBOSS_USER} USER ${JBOSS_USER} EXPOSE 8080 8443 9990 ENTRYPOINT ["/bin/bash", "-c"] CMD ["${JBOSS_HOME}/bin/standalone.sh -b 0.0.0.0"] WORKDIR /tmp ADD --chown=jboss ./install.sh . -RUN wget ${ARCHIVES_BASE_URL}/jboss-eap-7.3.0.zip \ - -q --no-cookies --no-check-certificate -O /tmp/jboss-eap-7.3.0.zip && \ - unzip -q /tmp/jboss-eap-7.3.0.zip -d ${JBOSS_USER_HOME} && \ - add-user.sh ${ADMIN_USER} ${ADMIN_PASSWORD} --silent && \ - ( standalone.sh --admin-only \ - & ( sudo chmod +x /tmp/install.sh && \ - install.sh && \ - rm -rf /tmp/install.sh && \ - sudo yum autoremove -y && \ - sudo yum clean all -y && \ - ( sudo rm -rf /tmp/* /var/cache/yum || echo "something was not removed..." ) ) ) +RUN wget ${ARCHIVES_BASE_URL}/jboss-eap-7.3.0.zip \ + -q --no-cookies --no-check-certificate -O /tmp/jboss-eap-7.3.0.zip && \ + unzip -q /tmp/jboss-eap-7.3.0.zip -d ${JBOSS_USER_HOME} && \ + add-user.sh ${ADMIN_USER} ${ADMIN_PASSWORD} --silent && \ + ( standalone.sh --admin-only \ + & ( sudo chmod +x /tmp/install.sh && \ + install.sh && \ + sudo apt-get purge -y unzip openssh-client && \ + sudo apt-get autoremove -y && \ + sudo apt-get autoclean -y && \ + ( sudo rm -rf /tmp/* || echo "cleanup!" ) ) ) WORKDIR ${JBOSS_USER_HOME} ############################################ USAGE ############################################## # # -# FROM daggerok/jboss-eap-7.3:7.3.0-centos # +# FROM daggerok/jboss-eap-7.3:7.3.0-debian # # # # # debug: # # ENV JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" # diff --git a/Dockerfile.debian-extends-jdk11 b/Dockerfile.debian-extends-jdk11 new file mode 100644 index 0000000..a57f985 --- /dev/null +++ b/Dockerfile.debian-extends-jdk11 @@ -0,0 +1,45 @@ +FROM daggerok/jboss-eap-7.3:7.3.0-debian +LABEL MAINTAINER="Maksim Kostromin " +ENV PRODUCT="jboss-eap-7.3" \ + JBOSS_USER="jboss" +ENV JBOSS_USER_HOME="/home/${JBOSS_USER}" \ + DOWNLOAD_BASE_URL="https://github.com/daggerok/${PRODUCT}/releases/download" \ + JBOSS_EAP_PATCH="7.3.0" +ENV JBOSS_HOME="${JBOSS_USER_HOME}/${PRODUCT}" \ + PATCHES_BASE_URL="${DOWNLOAD_BASE_URL}/${JBOSS_EAP_PATCH}" +ENV PATH="${JBOSS_HOME}/bin:/tmp:${PATH}" \ + JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0" +USER ${JBOSS_USER} +RUN sudo apt-get update -y +WORKDIR /tmp +ADD --chown=jboss ./install.sh . +RUN ( standalone.sh --admin-only \ + & ( sudo chmod +x /tmp/install.sh \ + && install.sh \ + && sudo apt-get autoremove -y \ + && sudo apt-get autoclean -y \ + && sudo rm -rf /tmp/* ) ) +WORKDIR ${JBOSS_USER_HOME} + +############################################ USAGE ############################################## +# # +# FROM daggerok/jboss-eap-7.3:7.3.0-debian # +# # +# # debug: # +# ENV JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" # +# EXPOSE 5005 # +# # +# # health-check: # +# HEALTHCHECK --retries=33 \ # +# --timeout=1s \ # +# --interval=1s \ # +# --start-period=3s \ # +# CMD wget -q --spider http://127.0.0.1:8080/my-service/health || exit 1 # +# #CMD curl -f http://127.0.0.1:8080/my-servicehealth || exit 1 # +# #CMD test `netstat -ltnp | grep 9990 | wc -l` -ge 1 || exit 1 # +# COPY --chown=jboss ./target/*.war ${JBOSS_HOME}/standalone/deployments/my-service.war # +# # +# # or multi-deployment: # +# COPY --chown=jboss ./target/*.war ./build/libs/*.war ${JBOSS_HOME}/standalone/deployments/ # +# # +################################################################################################# diff --git a/Dockerfile.debian-from-scratch-jdk11 b/Dockerfile.debian-from-scratch-jdk11 new file mode 100644 index 0000000..157d7f1 --- /dev/null +++ b/Dockerfile.debian-from-scratch-jdk11 @@ -0,0 +1,62 @@ +FROM openjdk:11.0.7-jdk-slim-buster +LABEL MAINTAINER="Maksim Kostromin " +ENV PRODUCT="jboss-eap-7.3" \ + JBOSS_USER="jboss" +ENV ADMIN_USER="admin" \ + ADMIN_PASSWORD="Admin.123" \ + JBOSS_USER_HOME="/home/${JBOSS_USER}" \ + DOWNLOAD_BASE_URL="https://github.com/daggerok/${PRODUCT}/releases/download" \ + JBOSS_EAP_PATCH="7.3.0" +ENV JBOSS_HOME="${JBOSS_USER_HOME}/${PRODUCT}" \ + ARCHIVES_BASE_URL="${DOWNLOAD_BASE_URL}/archives" \ + PATCHES_BASE_URL="${DOWNLOAD_BASE_URL}/${JBOSS_EAP_PATCH}" +ENV PATH="${JBOSS_HOME}/bin:/tmp:${PATH}" \ + JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0" +USER root +RUN ( apt-get update -y || echo "cannot update." ) && \ + apt-get install -y wget ca-certificates unzip sudo openssh-client net-tools && \ + echo "${JBOSS_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + sed -i "s/.*requiretty$/Defaults !requiretty/" /etc/sudoers && \ + addgroup --system --gid 1001 ${JBOSS_USER} && \ + adduser --system --home ${JBOSS_USER_HOME} --shell /bin/ash --gid 1001 --uid 1001 ${JBOSS_USER} +USER ${JBOSS_USER} +EXPOSE 8080 8443 9990 +ENTRYPOINT ["/bin/bash", "-c"] +CMD ["${JBOSS_HOME}/bin/standalone.sh -b 0.0.0.0"] +WORKDIR /tmp +ADD --chown=jboss ./install.sh . +RUN wget ${ARCHIVES_BASE_URL}/jboss-eap-7.3.0.zip \ + -q --no-cookies --no-check-certificate -O /tmp/jboss-eap-7.3.0.zip && \ + unzip -q /tmp/jboss-eap-7.3.0.zip -d ${JBOSS_USER_HOME} && \ + add-user.sh ${ADMIN_USER} ${ADMIN_PASSWORD} --silent && \ + ( standalone.sh --admin-only \ + & ( sudo chmod +x /tmp/install.sh && \ + install.sh && \ + sudo apt-get purge -y unzip openssh-client && \ + sudo apt-get autoremove -y && \ + sudo apt-get autoclean -y && \ + ( sudo rm -rf /tmp/* || echo "cleanup!" ) ) ) +WORKDIR ${JBOSS_USER_HOME} + +############################################ USAGE ############################################## +# # +# FROM daggerok/jboss-eap-7.3:7.3.0-debian # +# # +# # debug: # +# ENV JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" # +# EXPOSE 5005 # +# # +# # health-check: # +# HEALTHCHECK --retries=33 \ # +# --timeout=1s \ # +# --interval=1s \ # +# --start-period=3s \ # +# CMD wget -q --spider http://127.0.0.1:8080/my-service/health || exit 1 # +# #CMD curl -f http://127.0.0.1:8080/my-servicehealth || exit 1 # +# #CMD test `netstat -ltnp | grep 9990 | wc -l` -ge 1 || exit 1 # +# COPY --chown=jboss ./target/*.war ${JBOSS_HOME}/standalone/deployments/my-service.war # +# # +# # or multi-deployment: # +# COPY --chown=jboss ./target/*.war ./build/libs/*.war ${JBOSS_HOME}/standalone/deployments/ # +# # +################################################################################################# diff --git a/README.md b/README.md index 7cabffe..4a5ebea 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ JBoss EAP 7.3 Docker automation build based on centos8 / alpine3 images ## usage ```Dockerfile -FROM daggerok/jboss-eap-7.3:7.3.0-alpine +FROM daggerok/jboss-eap-7.3:7.3.0-debian COPY --chown=jboss ./target/*.war ${JBOSS_HOME}/standalone/deployments/my-service.war ``` @@ -73,4 +73,7 @@ git push origin --tags git tag 7.3.0-alpine git push origin --tags +git tag 7.3.0-debian +git push origin --tags + -->