Permalink
Browse files

fixed #115 - Updated prerequisites : libspring-instrument-java is not…

… needed
  • Loading branch information...
dzc34 committed Jan 19, 2018
1 parent 527be04 commit 996f6af544152a6a12d1c76e61a57250a91a9f6a
@@ -24,11 +24,13 @@ none

### Refactoring
- [#114 - Updated webapp/pom.xml - new name for .war, .tar.gz and .deb](https://github.com/Asqatasun/Contrast-Finder/issues/114)
- [#115 - Updated prerequisites : libspring-instrument-java is not needed](https://github.com/Asqatasun/Contrast-Finder/issues/115)

### Configuration
none

### Documentation
- [#115 - Updated prerequisites documentation](https://github.com/Asqatasun/Contrast-Finder/issues/115)
- [#114 - Updated documentation - new name for .war, .tar.gz and .deb](https://github.com/Asqatasun/Contrast-Finder/issues/114)

### Task
@@ -42,8 +42,6 @@ EXPOSE $WWWPORT

# build
RUN apt-get update && \
apt-get -y --no-install-recommends \
install libspring-instrument-java && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -59,9 +57,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
${TOMCAT_DIR}bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
${TOMCAT_DIR}lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -1,6 +1,9 @@


----- with libspring-instrument-java ---------------------------------------

commit 527be04da1385e05940051de27e2c356d9cedc5d

OK /distrib/debian-8_tomcat-7_legacy-debian
OK /test_tomcat-7-8/Ubuntu_14.04_tomcat7_full
OK /test_tomcat-7-8/Ubuntu_16.04_tomcat7_full
@@ -59,13 +62,13 @@ docker exec -ti contrast.finder /bin/bash
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/context.xml
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/MANIFEST.MF

DEBIAN 8
DEBIAN 8 Tomcat 7
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/distrib/debian-8_tomcat-7_legacy-debian --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_DEBIAN-8_withSpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
cat /usr/local/tomcat/contrast-finder/META-INF/context.xml
cat /usr/local/tomcat/webapps/contrast-finder/META-INF/context.xml
cat /usr/local/tomcat/webapps/contrast-finder/META-INF/MANIFEST.MF
ls -l /usr/share/java/spring3-instrument-tomcat.jar
ls -l /usr/local/tomcat/lib/spring3-instrument-tomcat.jar
@@ -0,0 +1,90 @@

----- build with jdk7 or jdk8

### JDK 7
docker pull asqatasun/asqa.mvn:contrast.finder_jdk7
docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqatasun/asqa.mvn:contrast.finder_jdk7 mvn clean install
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/ --log-build
docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqatasun/asqa.mvn:contrast.finder_jdk7 mvn clean
docker exec -ti contrast.finder /bin/bash
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/MANIFEST.MF

### JDK 8
docker pull asqatasun/asqa.mvn:contrast.finder_jdk8
docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqatasun/asqa.mvn:contrast.finder_jdk8 mvn clean install
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/ --log-build
docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqatasun/asqa.mvn:contrast.finder_jdk8 mvn clean
docker exec -ti contrast.finder /bin/bash
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/MANIFEST.MF


----- without libspring-instrument-java ---------------------------------------

OK /distrib/debian-8_tomcat-7_legacy-debian
OK /test_tomcat-7-8/Ubuntu_14.04_tomcat7_full
OK /test_tomcat-7-8/Ubuntu_16.04_tomcat7_full
OK /test_tomcat-7-8/Ubuntu_16.04_tomcat8_full
OK /test_tomcat-7-8/Ubuntu_18.04_tomcat8_full

---------------------------------------------------------------------

UBUNTU 18.04 Tomcat 8.5
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/test_tomcat-7-8/Ubuntu_18.04_tomcat8_full/ --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_UBUNTU-18.04_tomcat-8_without_SpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
ls -l /usr/share/java/spring3-instrument.jar
ls -l /usr/share/tomcat8/lib/spring3-instrument-tomcat.jar
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/context.xml
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/MANIFEST.MF

----------------------------------------------------------------------------------
18.04 vs 16.04 for libspring-instrument-java
https://packages.ubuntu.com/bionic/all/libspring-instrument-java/filelist
vs https://packages.ubuntu.com/xenial/all/libspring-instrument-java/filelist
----------------------------------------------------------------------------------

UBUNTU 16.04 Tomcat 8.0
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/test_tomcat-7-8/Ubuntu_16.04_tomcat8_full/ --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_UBUNTU-16.04_tomcat-8_without_SpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
ls -l /usr/share/java/spring3-instrument-tomcat.jar
ls -l /usr/share/tomcat8/lib/spring3-instrument-tomcat.jar
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/context.xml
cat /var/lib/tomcat8/webapps/contrast-finder/META-INF/MANIFEST.MF

UBUNTU 16.04 Tomcat 7
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/test_tomcat-7-8/Ubuntu_16.04_tomcat7_full/ --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_UBUNTU-16.04_tomcat-7_without_SpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
ls -l /usr/share/java/spring3-instrument-tomcat.jar
ls -l /usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/context.xml
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/MANIFEST.MF

UBUNTU 14.04 Tomcat 7
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/test_tomcat-7-8/Ubuntu_14.04_tomcat7_full --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_UBUNTU-14.04_without_SpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
ls -l /usr/share/java/spring3-instrument-tomcat.jar
ls -l /usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/context.xml
cat /var/lib/tomcat7/webapps/contrast-finder/META-INF/MANIFEST.MF

DEBIAN 8 Tomcat 7
-----------------------------
docker/build_and_run-with-docker.sh -l --source-dir ${PWD} --docker-dir docker/SNAPSHOT-local/distrib/debian-8_tomcat-7_legacy-debian --log-build
docker exec -ti contrast.finder /bin/cat /softwares-version.txt
docker logs --since 24h contrast.finder &> log_DEBIAN-8_without_SpringInstrumentClassLoader.log
docker exec -ti contrast.finder /bin/bash
cat /usr/local/tomcat/webapps/contrast-finder/META-INF/context.xml
cat /usr/local/tomcat/webapps/contrast-finder/META-INF/MANIFEST.MF
ls -l /usr/share/java/spring3-instrument-tomcat.jar
ls -l /usr/local/tomcat/lib/spring3-instrument-tomcat.jar
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat7 \
libspring-instrument-java && \
tomcat7 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat7/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat7 \
libspring-instrument-java && \
tomcat7 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat7/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat8 \
libspring-instrument-java && \
tomcat8 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat8/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat8/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat8 \
libspring-instrument-java && \
tomcat8 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat8/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument.jar \
/usr/share/tomcat8/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat7 \
libspring-instrument-java && \
tomcat7 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat7/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -33,8 +33,7 @@ RUN apt-get update && \
install wget \
curl \
ca-certificates \
tomcat7 \
libspring-instrument-java && \
tomcat7 && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
@@ -52,9 +51,7 @@ RUN apt-get update && \
java -version 2>> ${INFO_FILE} && \
echo "\n--- Tomcat ---------" >> ${INFO_FILE} && \
/usr/share/tomcat7/bin/version.sh >> ${INFO_FILE} && \
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE} && \
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
echo "\n--- Contrast-Finder ---" >> ${INFO_FILE}

#######################################################################################
# The command line "java -version" returns the output data
@@ -22,28 +22,17 @@ LABEL org.label-schema.schema-version = "1.0.0-rc.1"
# build variables
ARG LOG_DIR="/var/log/contrast-finder/"
ARG CONF_DIR="/etc/contrast-finder/"
ARG URL_FOR_SPRING_INSTRUMENT_JAR="https://repo.spring.io/release/org/springframework/spring-instrument-tomcat/4.3.13.RELEASE/spring-instrument-tomcat-4.3.13.RELEASE.jar"

##################################################################################################
# https://repo.spring.io/release/org/springframework/spring-instrument-tomcat/
# LAST https://repo.spring.io/release/org/springframework/spring-instrument-tomcat/4.3.13.RELEASE/
# JAR spring-instrument-tomcat-4.3.13.RELEASE.jar
# SHA1 spring-instrument-tomcat-4.3.13.RELEASE.jar.sha1
##################################################################################################

# environment variables
ENV SPRING_INSTRUMENT_SRC="${URL_FOR_SPRING_INSTRUMENT_JAR}" \
TOMCAT_DIR="/usr/local/tomcat/" \
ENV TOMCAT_DIR="/usr/local/tomcat/" \
LOG_FILE="${LOG_DIR}contrast-finder.log" \
CONF_FILE="${CONF_DIR}contrast-finder.conf" \
INFO_FILE="/softwares-version.txt" \
WWWPORT="8080"
EXPOSE $WWWPORT

# build
RUN cd ${TOMCAT_DIR}lib/ && \
wget ${SPRING_INSTRUMENT_SRC} && \
apk add --no-cache curl && \
RUN apk add --no-cache curl && \
mkdir -p ${LOG_DIR} && \
mkdir -p ${CONF_DIR} && \
touch ${LOG_FILE} && \
@@ -2,15 +2,17 @@

## Prerequesites

* Tomcat
* libspring-instrument-java
* Tomcat 7 or Tomcat 8


### Linux Ubuntu 14.04 and 16.04

```bash
apt-get --no-install-recommends install tomcat7
apt-get --no-install-recommends install libspring-instrument-java
ln -s /usr/share/java/spring3-instrument-tomcat.jar \
/usr/share/tomcat7/lib/spring3-instrument-tomcat.jar
apt-get --no-install-recommends install tomcat7
```

### Linux Ubuntu 16.04

```bash
apt-get --no-install-recommends install tomcat8
```
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context useHttpOnly="true" antiJARLocking="true" path="/color-finder">
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" useSystemClassLoaderAsParent="false"/>
</Context>
<Context useHttpOnly="true"
antiJARLocking="true"
path="/color-finder" />

0 comments on commit 996f6af

Please sign in to comment.