Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

parana/tomcat-xe-ubuntu

Oracle Java JDK 8 plus Oracle Express Edition 11g Release 2 on Ubuntu 14.04.1 LTS

This Dockerfile is a trusted build of Docker Registry.

Based on parana/web-xe-ubuntu Image

Installation

docker pull parana/tomcat-xe-ubuntu

Define in your .bash_profile this utility function:

docker-ip() { 
  boot2docker ip 2> /dev/null 
}

Run as a daemon with 1443, 8080, 22 and 1521 ports opened and mapped,
setting the hostname to db-server and sharing 1 volume, use the command:

mkdir -p  ~/dev/shared
docker run -d -h db-server -v ~/dev/shared:/usr/local/tomcat/shared  \
       -p 1443:1443 -p 4422:22 -p 1521:1521 -p 8080:8080  \
       --name mytomcat parana/tomcat-xe-ubuntu

The same, but sharing 3 volumes, use the command:

docker run -d -h db-server \
    -v ~/dev/shared:/usr/local/tomcat/shared \
    -v ~/dev/conf:/usr/local/tomcat/conf \
    -v ~/dev/webapps:/usr/local/tomcat/webapps \
    -p 1443:1443 -p 4422:22 -p 1521:1521 -p 8080:8080 \
    --name mytomcat parana/tomcat-xe-ubuntu

Is this case you need to prepare ~/dev directory first.

Connect database with following setting:

hostname: localhost
port: 1521
sid: xe
username: system
password: oracle

Password for SYS & SYSTEM is

oracle

From your MAC OSX terminal:

sqlplus system/oracle@$(docker-ip):1521/XE

Login by SSH

ssh root@$(docker-ip) -p 4422
password: admin

Connect via WebBrowser with following setting:

hostname: $(docker-ip)
port: 1443

open http://$(docker-ip):1443

To stop mytomcat container use:

docker stop mytomcat

To remove mytomcat container use:

docker rm mytomcat

To see mytomcat container details use:

docker ps | grep mytomcat

To remove an old container and start a new one use:

docker stop mytomcat 2> /dev/null  ; docker rm mytomcat 2> /dev/null  ; docker run -d -h db-server -p 1443:1443 -p 44222:22 -p 1521:1521 -p 8080:8080 --name mytomcat parana/tomcat-xe-ubuntu

Or defining an alias:

alias trun='docker stop mytomcat 2> /dev/null  ; docker rm mytomcat 2> /dev/null  ; docker run -d -h db-server -p 1443:1443 -p 44222:22 -p 1521:1521 -p 8080:8080 --name mytomcat parana/tomcat-xe-ubuntu'

Another usefull shell.

Save this on your ~/bin/ directory as docker-clean file:

#!/bin/sh                                                                                                                                                                            

remove_dangling() {
  echo "Removing dangling images ..."
  docker rmi $(docker images -f dangling=true -q)
}


remove_stopped_containers() {
   echo "Removing stopped containers ..."
   docker rm $(docker ps -qa)
}

case $1 in
   images)
       remove_dangling
       ;;
   containers)
       read -p "Are you sure you want to remove all stopped containers?" -n 1 -r
       echo  #
       if [[ $REPLY =~ ^[Yy]$ ]]
       then
           remove_stopped_containers
       fi
       ;;
   *)
       echo "usage: docker-clean containers|images   -  containers - removes all stopped containers it can.   images - removes dangling (un-needed) image layers - images you no longer need"
       ;;

esac

Chears !

Docker Pull Command
Owner
parana
Source Repository

Comments (1)
hunghn
a year ago

What is the user and password of tomcat?