I have started learning docker and having hard time getting a tomcat container setup manually. The idea is to create an image manually and then translate the steps into a docker file. Listing steps performed so far.
Using aws EC2 Centos micro instance for learning docker
Docker daemon is up and running
Docker usergroup has also been setup and I run docker as normal user
Installed oracle JDK as below:
wget --no-cookies --no-check-certificate --header "Cookie:\
gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; \
oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm'
Installed tomcat using yum ( Have tried manual method using the gz file also but did not help ):
yum install tomcat.noarch tomcat-admin-webapps.noarch tomcat-webapps.noarch
Edited "/etc/tomcat/tomcat.conf" to add /usr/java/latest as JAVA_HOME
Committed the changes to container:
docker commit 42b0beb497f9 $USER/tomcat_install
docker run -d -p 8080:8080 $USER/tomcat_install /usr/sbin/tomcat start -D FOREGROUND
Output: SHA Checksum
But the container exits giving the error below:
`enter code here /usr/sbin/tomcat: line 21: .: /etc/sysconfig/: is a directory`
Upon relevant searches I found out that this errors comes because of open jdk use instead of oracle jdk. As above, i started using oracle jdk.
Please note: Since I am learning, i do not want to download official tomcat image and use it since it makes it too easy. Although for comparison i did download that image but still unable to resolve the issue. Some suggestions to resolve this and have my own tomcat image would be awesome