Skip to content

Commit

Permalink
Docker - fixed #116 + fixed #117
Browse files Browse the repository at this point in the history
#116 - Added new docker image: alpine (tomcat-8.5)
#117 - Added some new pre-requisites_* Docker images
       -> debian 9
       -> ubuntu 18.04 (next LTS)
  • Loading branch information
dzc34 committed Jan 22, 2018
1 parent 83c6b8a commit c2219e9
Show file tree
Hide file tree
Showing 17 changed files with 609 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ none

### Improvement
- [#110 - Added new docker image: ubuntu 16.04 (tomcat-7)](https://github.com/Asqatasun/Contrast-Finder/issues/110)
- [#112 - Added new docker image: alpine 3.7 (tomcat-7)](https://github.com/Asqatasun/Contrast-Finder/issues/112)
- [#109 - Docker/pre-requisites/ - Added /etc/contrast-finder/softwares-version.txt](https://github.com/Asqatasun/Contrast-Finder/issues/109)
- [#112 - Added new docker image: alpine (tomcat-7)](https://github.com/Asqatasun/Contrast-Finder/issues/112)
- [#116 - Added new docker image: alpine (tomcat-8.5)](https://github.com/Asqatasun/Contrast-Finder/issues/116)
- [#117 - Added some new pre-requisites_* Docker images (debian 9, ubuntu 18.04)](https://github.com/Asqatasun/Contrast-Finder/issues/117)
- [#109 - Docker/pre-requisites/ - Added /softwares-version.txt](https://github.com/Asqatasun/Contrast-Finder/issues/109)

### Refactoring
- [#114 - Updated webapp/pom.xml - new name for .war, .tar.gz and .deb](https://github.com/Asqatasun/Contrast-Finder/issues/114)
Expand Down
2 changes: 1 addition & 1 deletion docker/RELEASE/alpine_tomcat-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ ENV SRC=${SRC_URL}
# ${LOG_FILE}
###################################################

# in "tomcat:7.0-jre7" DockerFile
# in "tomcat:7-jre7-alpine" DockerFile
# CMD ["catalina.sh", "run"]

82 changes: 82 additions & 0 deletions docker/RELEASE/alpine_tomcat-8.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM asqatasun/contrast-finder:pre-requisites_Alpine_tomcat-8.5
LABEL org.label-schema.schema-version = "1.0.0-rc.1" \
org.label-schema.name = "Contrast-Finder - WebApp (tomcat 8.5 < jdk 8 < 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-webapp_0.8.4-SNAPSHOT.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-webapp_${CONTRAST_FINDER_RELEASE}.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_tomcat-8.5 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_Alpine_tomcat-8.5/Dockerfile
# |-- tomcat:8.5-jre8-alpine https://github.com/docker-library/tomcat/blob/master/8.5/jre8-alpine/Dockerfile
# |-- openjdk:8-jre-alpine https://github.com/docker-library/openjdk/blob/master/8-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-webapp_${CONTRAST_FINDER_RELEASE}.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_Alpine_tomcat-8.5


###### don't work ############################
# CMD catalina.sh run ; \
# tail -f -n 200 ${TOMCAT_DIR}logs/catalina.*.log \
# ${LOG_FILE}
###################################################

# in "tomcat:8.5-jre8-alpine" DockerFile
# CMD ["catalina.sh", "run"]

1 change: 1 addition & 0 deletions docker/RELEASE/alpine_tomcat-8.5/README.md
2 changes: 1 addition & 1 deletion docker/SNAPSHOT-local/distrib/alpine_tomcat-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ RUN cd /root/contrast-*/install/ && \
# ${LOG_FILE}
###################################################

# in "tomcat:7.0-jre7" DockerFile
# in "tomcat:7-jre7-alpine" DockerFile
# CMD ["catalina.sh", "run"]
58 changes: 58 additions & 0 deletions docker/SNAPSHOT-local/distrib/alpine_tomcat-8.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM asqatasun/contrast-finder:pre-requisites_Alpine_tomcat-8.5

# #### 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_tomcat-8.5 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_Alpine_tomcat-8.5/Dockerfile
# |-- tomcat:8.5-jre8-alpine https://github.com/docker-library/tomcat/blob/master/8.5/jre8-alpine/Dockerfile
# |-- openjdk:8-jre-alpine https://github.com/docker-library/openjdk/blob/master/8-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-webapp_${CONTRAST_FINDER_RELEASE}.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_Alpine_tomcat-8.5


###### don't work ############################
# CMD catalina.sh run ; \
# tail -f -n 200 ${TOMCAT_DIR}logs/catalina.*.log \
# ${LOG_FILE}
###################################################

# in "tomcat:8.5-jre8-alpine" DockerFile
# CMD ["catalina.sh", "run"]
47 changes: 47 additions & 0 deletions docker/SNAPSHOT-local/distrib/debian-9_tomcat-8.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM asqatasun/contrast-finder:pre-requisites_Debian-9_tomcat-8.5

# #### 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_Debian-9_tomcat-8.5 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_Debian-9_tomcat-8.5/Dockerfile
# |-- debian:9 https://github.com/debuerreotype/docker-debian-artifacts/blob/dist-amd64/stretch/Dockerfile
###################################################################

# environment variables
ENV CONTRAST_FINDER_RELEASE="0.8.4-SNAPSHOT"

# Add contrast-finder .war
ADD contrast-finder-webapp_${CONTRAST_FINDER_RELEASE}.tar.gz /root

# Install contrast-finder
RUN cd /root/contrast-*/install/ && \
mv -v contrast-*.war contrast-finder.war && \
mv -v contrast-*.war /var/lib/tomcat8/webapps && \
rm -rf /root/contrast-* && \
echo ${CONTRAST_FINDER_RELEASE} >> ${INFO_FILE} && \
echo "\n--- ${CONF_FILE} ---" >> ${INFO_FILE} && \
cat ${CONF_FILE} >> ${INFO_FILE} && \
echo "\n--- Logs -----------" >> ${INFO_FILE} && \
echo "${TOMCAT_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_Debian-9_tomcat-8.5

CMD service tomcat8 start ; \
tail -f -n 50 ${TOMCAT_LOG} \
${LOG_FILE}
47 changes: 47 additions & 0 deletions docker/SNAPSHOT-local/distrib/ubuntu-16.04_tomcat-8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM asqatasun/contrast-finder:pre-requisites_Ubuntu-16.04_tomcat-8.0

# #### 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_Ubuntu-16.04_tomcat-8.0 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_Ubuntu-16.04_tomcat-8.0/Dockerfile
# |-- ubuntu:16.04 https://github.com/tianon/docker-brew-ubuntu-core/blob/dist-amd64/xenial/Dockerfile
###################################################################

# environment variables
ENV CONTRAST_FINDER_RELEASE="0.8.4-SNAPSHOT"

# Add contrast-finder .war
ADD contrast-finder-webapp_${CONTRAST_FINDER_RELEASE}.tar.gz /root

# Install contrast-finder
RUN cd /root/contrast-*/install/ && \
mv -v contrast-*.war contrast-finder.war && \
mv -v contrast-*.war /var/lib/tomcat8/webapps && \
rm -rf /root/contrast-* && \
echo ${CONTRAST_FINDER_RELEASE} >> ${INFO_FILE} && \
echo "\n--- ${CONF_FILE} ---" >> ${INFO_FILE} && \
cat ${CONF_FILE} >> ${INFO_FILE} && \
echo "\n--- Logs -----------" >> ${INFO_FILE} && \
echo "${TOMCAT_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_Ubuntu-16.04_tomcat-8.0

CMD service tomcat8 start ; \
tail -f -n 50 ${TOMCAT_LOG} \
${LOG_FILE}
48 changes: 48 additions & 0 deletions docker/SNAPSHOT-local/distrib/ubuntu-18.04_tomcat-8.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM asqatasun/contrast-finder:pre-requisites_Ubuntu-18.04_tomcat-8.5

# #### 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_Ubuntu-18.04_tomcat-8.5 https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_Ubuntu-18.04_tomcat-8.5/Dockerfile
# |-- ubuntu:18.04 https://github.com/tianon/docker-brew-ubuntu-core/blob/dist-amd64/bionic/Dockerfile

###################################################################

# environment variables
ENV CONTRAST_FINDER_RELEASE="0.8.4-SNAPSHOT"

# Add contrast-finder .war
ADD contrast-finder-webapp_${CONTRAST_FINDER_RELEASE}.tar.gz /root

# Install contrast-finder
RUN cd /root/contrast-*/install/ && \
mv -v contrast-*.war contrast-finder.war && \
mv -v contrast-*.war /var/lib/tomcat8/webapps && \
rm -rf /root/contrast-* && \
echo ${CONTRAST_FINDER_RELEASE} >> ${INFO_FILE} && \
echo "\n--- ${CONF_FILE} ---" >> ${INFO_FILE} && \
cat ${CONF_FILE} >> ${INFO_FILE} && \
echo "\n--- Logs -----------" >> ${INFO_FILE} && \
echo "${TOMCAT_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_Ubuntu-18.04_tomcat-8.5

CMD service tomcat8 start ; \
tail -f -n 50 ${TOMCAT_LOG} \
${LOG_FILE}
Loading

0 comments on commit c2219e9

Please sign in to comment.