-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #112 - Added new docker image: alpine 3.7 (tomcat-7)
- Loading branch information
Showing
5 changed files
with
230 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
FROM asqatasun/contrast-finder:pre-requisites_alpine-3.7_tomcat-7 | ||
LABEL org.label-schema.schema-version = "1.0.0-rc.1" \ | ||
org.label-schema.name = "Contrast-Finder - WebApp (tomcat7 < jdk7 < alpine 3.7)" \ | ||
org.label-schema.version = "0.8.4-SNAPSHOT" \ | ||
org.label-schema.url = "https://contrast-finder.org" \ | ||
org.label-schema.vcs-url = "https://github.com/Asqatasun/Contrast-Finder" \ | ||
org.label-schema.docker.cmd = "docker run -p 8087:8080 -d asqatasun/contrast-finder:alpine" \ | ||
org.label-schema.usage = "https://github.com/Asqatasun/Contrast-Finder/tree/develop/documentation/" \ | ||
org.label-schema.description = "Contrast-Finder finds correct color contrasts for web accessibility." | ||
# ----> documentation http://label-schema.org/ | ||
|
||
# #### usage ###################################################### | ||
# | ||
# --- Building this docker image | ||
# docker build -t asqatasun/contrast-finder . | ||
# docker build -t asqatasun/contrast-finder --build-arg CONTRAST_FINDER_RELEASE=0.8.4-SNAPSHOT . | ||
# docker build -t asqatasun/contrast-finder --build-arg SRC_URL_PREFIX=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.8.4-SNAPSHOT/ . | ||
# docker build -t asqatasun/contrast-finder --build-arg SRC_URL=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.8.4-SNAPSHOT/contrast-finder_0.8.4-SNAPSHOT.i386.tar.gz . | ||
# | ||
# --- Launch a container | ||
# docker run -p 127.0.0.1:8087:8080 --name contrast.finder -d asqatasun/contrast-finder | ||
# | ||
# --- Playing with this docker image | ||
# docker exec -ti contrast.finder /bin/cat /softwares-version.txt | ||
# docker exec -ti contrast.finder /bin/bash | ||
# docker logs -f contrast.finder | ||
# | ||
# #### source code ############################################### | ||
# https://github.com/Asqatasun/Contrast-Finder/releases/download/v${CONTRAST_FINDER_RELEASE}/contrast-finder_${CONTRAST_FINDER_RELEASE}.i386.tar.gz | ||
# could be overridden with --build-arg CONTRAST_FINDER_RELEASE=<release> | ||
# could be overridden with --build-arg SRC_URL_PREFIX=<url_prefix> | ||
# could be overridden with --build-arg SRC_URL=<url> | ||
# | ||
# #### FROM ###################################################### | ||
# asqatasun/contrast-finder:pre-requisites_alpine-3.7_tomcat-7 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/contrast-finder:pre-requisites_alpine-3.7_tomcat-7/Dockerfile | ||
# |-- tomcat:7-jre7-alpine https://github.com/docker-library/tomcat/blob/master/7/jre7-alpine/Dockerfile | ||
# |-- openjdk:7-jre-alpine https://github.com/docker-library/openjdk/blob/master/7-jre/alpine/Dockerfile | ||
# |-- alpine:3.7 https://github.com/gliderlabs/docker-alpine/blob/master/versions/library-3.7/x86_64/Dockerfile | ||
################################################################### | ||
|
||
# build variables | ||
ARG CONTRAST_FINDER_RELEASE="0.8.4-SNAPSHOT" | ||
ARG SRC_URL_PREFIX="https://github.com/Asqatasun/Contrast-Finder/releases/download/v${CONTRAST_FINDER_RELEASE}" | ||
ARG SRC_URL="${SRC_URL_PREFIX}/contrast-finder_${CONTRAST_FINDER_RELEASE}.i386.tar.gz" | ||
|
||
# Install contrast-finder | ||
RUN cd /root/ && \ | ||
wget ${SRC_URL} && \ | ||
tar -xzvf contrast-*.tar.gz && \ | ||
cd /root/contrast-*/install/ && \ | ||
mv -v contrast-*.war contrast-finder.war && \ | ||
mv -v contrast-*.war ${TOMCAT_DIR}webapps && \ | ||
rm -rf /root/contrast-* && \ | ||
echo ${CONTRAST_FINDER_RELEASE} >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- ${CONF_FILE} ---" >> ${INFO_FILE} && \ | ||
cat ${CONF_FILE} >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- Logs -----------" >> ${INFO_FILE} && \ | ||
echo "${TOMCAT_DIR}logs/catalina.*.log" >> ${INFO_FILE} && \ | ||
echo "${LOG_FILE}" >> ${INFO_FILE} && \ | ||
echo "--------------------" >> ${INFO_FILE} && \ | ||
cat ${INFO_FILE} > ${LOG_FILE} && echo "-- Install: Ok" | ||
|
||
# environment variables | ||
ENV CONTRAST_FINDER=${CONTRAST_FINDER_RELEASE} | ||
ENV SRC=${SRC_URL} | ||
|
||
|
||
# Health Check of the Docker Container | ||
# ----> see asqatasun/contrast-finder:pre-requisites_(...) | ||
|
||
|
||
###### don't work ############################ | ||
# CMD catalina.sh run ; \ | ||
# tail -f -n 200 ${TOMCAT_DIR}logs/catalina.*.log \ | ||
# ${LOG_FILE} | ||
################################################### | ||
|
||
# in "tomcat:7.0-jre7" DockerFile | ||
# CMD ["catalina.sh", "run"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
57 changes: 57 additions & 0 deletions
57
docker/SNAPSHOT-local/distrib/alpine-3.7_tomcat-7/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM asqatasun/contrast-finder:pre-requisites_alpine-3.7_tomcat-7 | ||
|
||
# #### usage ###################################################### | ||
# | ||
# --- Building this docker image | ||
# docker build -t asqatasun/contrast-finder:SNAPSHOT_local . | ||
# | ||
# --- Launch a container | ||
# docker run -p 127.0.0.1:8087:8080 --name contrast.finder -d asqatasun/contrast-finder:SNAPSHOT_local | ||
# | ||
# --- Playing with this docker image | ||
# docker exec -ti contrast.finder /bin/cat /softwares-version.txt | ||
# docker exec -ti contrast.finder /bin/bash | ||
# docker logs -f contrast.finder | ||
# | ||
# #### FROM ###################################################### | ||
# asqatasun/contrast-finder:pre-requisites_alpine-3.7_tomcat-7 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/contrast-finder:pre-requisites_alpine-3.7_tomcat-7/Dockerfile | ||
# |-- tomcat:7-jre7-alpine https://github.com/docker-library/tomcat/blob/master/7/jre7-alpine/Dockerfile | ||
# |-- openjdk:7-jre-alpine https://github.com/docker-library/openjdk/blob/master/7-jre/alpine/Dockerfile | ||
# |-- alpine:3.7 https://github.com/gliderlabs/docker-alpine/blob/master/versions/library-3.7/x86_64/Dockerfile | ||
################################################################### | ||
|
||
# environment variables | ||
ENV CONTRAST_FINDER_RELEASE="0.8.4-SNAPSHOT" | ||
|
||
# Add contrast-finder .war | ||
ADD contrast-finder_${CONTRAST_FINDER_RELEASE}.i386.tar.gz /root | ||
|
||
# Install contrast-finder | ||
RUN cd /root/contrast-*/install/ && \ | ||
mv -v contrast-*.war contrast-finder.war && \ | ||
mv -v contrast-*.war ${TOMCAT_DIR}webapps && \ | ||
rm -rf /root/contrast-* && \ | ||
echo ${CONTRAST_FINDER_RELEASE} >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- ${CONF_FILE} ---" >> ${INFO_FILE} && \ | ||
cat ${CONF_FILE} >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- Logs -----------" >> ${INFO_FILE} && \ | ||
echo "${TOMCAT_DIR}logs/catalina.*.log" >> ${INFO_FILE} && \ | ||
echo "${LOG_FILE}" >> ${INFO_FILE} && \ | ||
echo "--------------------" >> ${INFO_FILE} && \ | ||
cat ${INFO_FILE} > ${LOG_FILE} && echo "-- Install: Ok" | ||
|
||
|
||
# Health Check of the Docker Container | ||
# ----> see asqatasun/contrast-finder:pre-requisites_(...) | ||
|
||
|
||
###### don't work ############################ | ||
# CMD catalina.sh run ; \ | ||
# tail -f -n 200 ${TOMCAT_DIR}logs/catalina.*.log \ | ||
# ${LOG_FILE} | ||
################################################### | ||
|
||
# in "tomcat:7.0-jre7" DockerFile | ||
# CMD ["catalina.sh", "run"] |
86 changes: 86 additions & 0 deletions
86
docker/pre-requisites/pre-requisites_alpine-3.7_tomcat-7/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
FROM tomcat:7-jre7-alpine | ||
LABEL org.label-schema.schema-version = "1.0.0-rc.1" \ | ||
org.label-schema.name = "Contrast-Finder - WebApp pre-requisites (tomcat7 < jdk7 < alpine 3.7)" \ | ||
org.label-schema.url = "https://contrast-finder.org" \ | ||
org.label-schema.vcs-url = "https://github.com/Asqatasun/Contrast-Finder" \ | ||
org.label-schema.version = "0.8.4-SNAPSHOT" | ||
# ----> documentation http://label-schema.org/ | ||
|
||
# #### usage ###################################################### | ||
# | ||
# --- Building this docker image | ||
# docker build -t contrast-finder:pre-requisites_Alpine-3.7_Tomcat-7 . | ||
# | ||
# #### FROM ###################################################### | ||
# tomcat:7-jre7-alpine https://github.com/docker-library/tomcat/blob/master/7/jre7-alpine/Dockerfile | ||
# |-- openjdk:7-jre-alpine https://github.com/docker-library/openjdk/blob/master/7-jre/alpine/Dockerfile | ||
# |-- alpine:3.7 https://github.com/gliderlabs/docker-alpine/blob/master/versions/library-3.7/x86_64/Dockerfile | ||
################################################################### | ||
|
||
###### PRE-REQUISITES ########################################################## | ||
|
||
# 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/" \ | ||
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 && \ | ||
mkdir -p ${LOG_DIR} && \ | ||
mkdir -p ${CONF_DIR} && \ | ||
touch ${LOG_FILE} && \ | ||
touch ${CONF_FILE} && \ | ||
echo "--- OS -------------" >> ${INFO_FILE} && \ | ||
cat /etc/os-release >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- Java -----------" >> ${INFO_FILE} && \ | ||
echo ${JAVA_HOME} >> ${INFO_FILE} && \ | ||
java -version 2>> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- Tomcat ---------" >> ${INFO_FILE} && \ | ||
${TOMCAT_DIR}bin/version.sh >> ${INFO_FILE} && \ | ||
echo "" >> ${INFO_FILE} && \ | ||
echo "--- Contrast-Finder ---" >> ${INFO_FILE} | ||
|
||
|
||
####################################################################################### | ||
# The command line "java -version" returns the output data | ||
# at the STDERR stream (2 : error messages) rather than STDOUT (1). | ||
# -----> java -version 2> tmp.txt | ||
# | ||
# https://stackoverflow.com/questions/21453774/redirect-java-version-to-file-or-variable | ||
# https://stackoverflow.com/questions/39619087/how-to-write-output-of-java-version-to-a-text-file | ||
####################################################################################### | ||
|
||
|
||
# Health Check of the Docker Container | ||
HEALTHCHECK --timeout=3s \ | ||
CMD curl --fail http://localhost:8080/contrast-finder/ || exit 1 | ||
###################################################################### | ||
# doc: https://docs.docker.com/engine/reference/builder/#healthcheck | ||
# options: --interval=DURATION (default: 30s) | ||
# --timeout=DURATION (default: 30s) | ||
# --retries=N (default: 3) | ||
# can be overridden at the command line 'docker run --health-cmd (...)' | ||
###################################################################### | ||
|
||
# in "tomcat:7-jre7-alpine" DockerFile | ||
# CMD ["catalina.sh", "run"] |