Code Monkey home page Code Monkey logo

docker-tomcat8's Introduction

docker-tomcat

dockeri.co

Ubuntu 18.04, OpenJDK 11 and Tomcat 8.5 tag available.

Includes:

  • Ubuntu 18.04 Bionic
  • OpenJDK 11
  • Tomcat 8.5.50
  • git, wget, curl, build-essential

Old tags based on Oracle JDK 8 will no longer be updated due to Oracle changing licensing.

IMPORTANT: In a future update, the latest tag will be changed and will yield bionic-8.5-openjdk11. So if you depend on latest, please change that and use an specific tag instead.

Description

You should run this container in the background and mount the volume with your web app inside.

The latest tag is based on Ubuntu 14.04. Should you prefer Ubuntu 16.04, please use the xenial tag. For Ubuntu 18.04 and OpenJDK11, use the bionic-8.5-openjdk11.

There's also a tomcat8.5 tag, which includes:

  • Ubuntu 16.04 Xenial based only
  • Oracle JDK 1.8u201
  • Tomcat 8.5.39
  • Git, wget, curl, build-essential

Volumes

Exports a volume on /opt/tomcat/webapps. You can mount the volume on run to a local directory containing your war file or exploded war directory. If you need the management app, remember to have a copy on your hosts volume mount point.

Ports

Two ports are exposed:

  • 8080: default Tomcat port.

  • 8009: default Tomcat debug port.

Remember to map the ports to the docker host on run.

How to run the container

Using docker

You need docker v1.3+ installed. To get the container up and running, run:

sudo docker run -d -p 8080:8080 -p 8009:8009 -v /opt/tomcat/webapps:/opt/tomcat/webapps dordoka/tomcat

Remember to change /opt/tomcat/webapps to the directory where your app is stored.

If you prefer the Ubuntu 16.04 based image instead of the default 14.04 one, just use the xenial tag:

sudo docker run -d -p 8080:8080 -p 8009:8009 -v /opt/tomcat/webapps:/opt/tomcat/webapps dordoka/tomcat:xenial

For Ubuntu 18.04 and OpenJDK11, use the bionic-8.5-openjdk11

Using docker compose

If you have docker-compose installed, you can just launch:

sudo docker-compose up

A warning regarding admin user for tomcat management console

Please note that the image contains a tomcat-users.xml file, including an admin user (password admin). For the time being, should you wish to change that, fork this repo and modify the xml file accordingly.

docker-tomcat8's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-tomcat8's Issues

java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler

I got a error after i run the docker image on Mac high sierra

java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) at java.lang.Class.getConstructor0(Class.java:3075) at java.lang.Class.getConstructor(Class.java:1825) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:266) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453) Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.log.SystemLogHandler at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 6 more

Earlier versions worked without any problem. But Now i am getting a above error.

Potential security issue

Hi Carlos Moro @dordoka

Thanks very much for your tomcat8 docker image, this has been working very well for me.

I just wanted to point out what can be a potential security issue: some people might be using your image without realising that there's a admin/admin tomcat user. An attacker can login into tomcat console and deploy a malicious WAR file.

I suggest removing this tomcat-users.xml completely, and let image users to extend your image adding their own users/passwords. I can raise a PR for that if you want me to.

Hope this helps.

Best,
Miguel

Tomcat support Http11AprProtocol

When modifying server.xml to use protocol="org.apache.coyote.http11.Http11AprProtocol", it reports that
03-Sep-2020 02:09:23.265 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-443]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-443]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:568) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:871) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:592) at org.apache.catalina.startup.Catalina.load(Catalina.java:615) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:308) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:482) Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available at org.apache.catalina.connector.Connector.initInternal(Connector.java:954) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ... 12 more

So tomcat needs apr-xxx.tar.gz and apr-util-xxx.tar.gz and tomcat-native.tar.gz to support APR. Will you help add it into the docker image?

tomcat outdated version 8.0.37

The version needs updating. Currently, the available versions at that location are :

[DIR] Parent Directory -
[DIR] v8.0.39/ 14-Nov-2016 10:05 -
[DIR] v8.5.8/ 08-Nov-2016 11:45 -
[DIR] v8.5.9/ 08-Dec-2016 21:50 -

Tomcat not available

Installed it through kitematic in windows 7. It exposed 8080 port to 32769 and 8009 to 32768. In the browser I used the address http://192.168.99.100:32769, but I am getting the message "This site can't be reached"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.