I got some problem when i was trying to run this command
docker run -d -t -p 203:22 -p 7003:8080 -v /home/test/webapps:/usr/local/tomcat8/webapps/ --name tomcat3 tomcat
this command can be executed correctly,but the tomcat server in the docker would stopped like this:
07-Mar-2017 10:10:24.341 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat8/webapps/examples
07-Mar-2017 10:10:25.011 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat8/webapps/examples has finished in 669 ms
07-Mar-2017 10:10:25.011 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat8/webapps/host-manager
07-Mar-2017 10:10:25.069 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat8/webapps/host-manager has finished in 58 ms
07-Mar-2017 10:10:25.069 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat8/webapps/docs
07-Mar-2017 10:10:25.116 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat8/webapps/docs has finished in 47 ms
07-Mar-2017 10:10:25.117 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat8/webapps/ROOT
07-Mar-2017 10:10:25.147 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat8/webapps/ROOT has finished in 30 ms
07-Mar-2017 10:10:25.159 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
07-Mar-2017 10:10:25.171 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
07-Mar-2017 10:10:25.171 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1757 ms
07-Mar-2017 10:11:31.418 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
07-Mar-2017 10:11:31.420 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
07-Mar-2017 10:11:31.425 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
07-Mar-2017 10:11:31.426 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
07-Mar-2017 10:11:31.495 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
07-Mar-2017 10:11:31.499 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
07-Mar-2017 10:11:31.499 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
07-Mar-2017 10:11:31.500 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
But that is not the case in the following command.
docker run -d -t -p 201:22 -p 7001:8080 --name tomcat1 tomcat
this command would execute exactly correct.The only different between them is the flag -v in my opinion.Here is my Dockerfile and supervisord config
[supervisord]
nodaemon=true
[program:tomcat]
command=/usr/local/tomcat8/bin/catalina.sh run
environment=JAVA_HOME="/usr/local/java/jdk8/",JAVA_BIN="/usr/local/java/jdk8/bin"
autostart = true
autorestart=true
[program:sshd]
command=/usr/sbin/sshd -D
#Dockerfile
FROM tomcat
EXPOSE 22 8080
CMD ["/usr/bin/supervisord"]
Related
I have the webapp/API which is built on resteasy framework and recently my company decided to convert this application into Container because of the cloud migration indicative. so I created the
dockerfile
FROM tomcat:8.5.47-jdk8-openjdk
COPY ./target/myapp.war /usr/local/tomcat/webapps
and executed below commands to generate the image and then run the container locally
docker build -t myappimage .
docker run -p 8080:8080 myappimage
container is up and I do the swagger page on
http://localhost:8080/myapp
which has a list of all of the application endpoint and I select one endpoint and enter the request body then I receive below error
<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Servlet execution threw an exception</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Causejava.lang.NoSuchMethodError: org.jboss.resteasy.core.ResourceMethodInvoker.isSse()Z
org.jboss.resteasy.plugins.providers.sse.SseEventSinkInterceptor.filter(SseEventSinkInterceptor.java:31)
org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:262)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:235)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.Apache Tomcat/8.5.47
this was I see when on below command
docker logs amazing_lalande
19-Oct-2022 19:26:23.958 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.47
19-Oct-2022 19:26:23.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Oct 7 2019 13:30:46 UTC
19-Oct-2022 19:26:23.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.47.0
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.10.16.3-microsoft-standard-WSL2
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/local/openjdk-8/jre
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_232-b09
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
19-Oct-2022 19:26:23.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
19-Oct-2022 19:26:23.964 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
19-Oct-2022 19:26:23.964 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
19-Oct-2022 19:26:23.964 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
19-Oct-2022 19:26:23.964 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
19-Oct-2022 19:26:23.965 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
19-Oct-2022 19:26:23.965 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
19-Oct-2022 19:26:23.965 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
19-Oct-2022 19:26:23.965 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
19-Oct-2022 19:26:23.965 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.5.2].
19-Oct-2022 19:26:23.966 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
19-Oct-2022 19:26:23.966 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
19-Oct-2022 19:26:23.973 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0l 10 Sep 2019]
19-Oct-2022 19:26:24.047 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
19-Oct-2022 19:26:24.060 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
19-Oct-2022 19:26:24.070 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
19-Oct-2022 19:26:24.071 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
19-Oct-2022 19:26:24.072 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 430 ms
19-Oct-2022 19:26:24.096 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
19-Oct-2022 19:26:24.096 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.47
19-Oct-2022 19:26:24.121 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/NatCrim.war]
19-Oct-2022 19:26:29.021 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that w
ere scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
19-Oct-2022 19:26:29.808 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/NatCrim.war] has finished in [5,686] ms
19-Oct-2022 19:26:29.809 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
19-Oct-2022 19:26:29.826 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [17] ms
19-Oct-2022 19:26:29.826 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
19-Oct-2022 19:26:29.968 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [142] ms
19-Oct-2022 19:26:29.969 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
19-Oct-2022 19:26:29.978 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [9] ms
19-Oct-2022 19:26:29.979 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
19-Oct-2022 19:26:29.988 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [9] ms
19-Oct-2022 19:26:29.988 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
19-Oct-2022 19:26:30.002 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [14] ms
19-Oct-2022 19:26:30.007 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
19-Oct-2022 19:26:30.014 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
19-Oct-2022 19:26:30.016 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 5944 ms
Any help is appreciated!!
I can build the Dockerfile. When I do docker run -it path-to-image/tomcat9:latest and check the logs, there isn't a catalina.out and the run fail with getting /bin/sh: ["catalina.sh",: command not found.
Here is my Dockerfile
FROM gitlab-registry.gs.mil/gets-development/docker/openjdk11
USER root
# Copy Tomcat and start
ADD imageFiles/apache-tomcat-9.0.65.tar.gz /usr/local/
RUN mv /usr/local/apache-tomcat-9.0.65/ /usr/local/tomcat
ENV WORKPATH /usr/local
WORKDIR $WORKPATH
ENV CATALINA_HOME /usr/local/tomcat
ENV CATALINA_BASE /usr/local/tomcat
ENV PATH $PATH:$CATALINA_HOME/bin:$CATALINA_HOME/lib
EXPOSE 8080
CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]
Build command:
docker build -t gitlab-registry.gs.mil/gets-development/docker/tomcat9-test .
Start command:
docker run --name tomcatTest -it gitlab-registry.gs.mil/gets-development/docker/tomcat9-test:latest /bin/bash
Trying to connect inside the docker container to the localhost fails
curl: (7) Failed to connect to localhost port 8080: Connection refused
There are no log files
[root#b058163e9605 local]# cd tomcat/logs/
[root#b058163e9605 logs]# ls -als
total 0
0 drwxr-x--- 2 root root 6 Jul 14 12:28 .
0 drwxr-xr-x 9 root root 220 Aug 5 16:17 ..
[root#b058163e9605 logs]#
This is telling me that Tomcat did not start. Starting Tomcat inside the container, tomcat could launch success:
[root#b058163e9605 bin]# ./catalina.sh run
.....
08-Aug-2022 13:12:02.934 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
08-Aug-2022 13:12:03.038 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1590] milliseconds
08-Aug-2022 13:12:03.204 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
08-Aug-2022 13:12:03.205 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.65]
08-Aug-2022 13:12:03.224 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
08-Aug-2022 13:12:03.877 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [652] ms
08-Aug-2022 13:12:03.879 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
08-Aug-2022 13:12:03.945 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [66] ms
08-Aug-2022 13:12:03.947 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
08-Aug-2022 13:12:04.559 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [613] ms
08-Aug-2022 13:12:04.562 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
08-Aug-2022 13:12:04.626 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [63] ms
08-Aug-2022 13:12:04.626 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
08-Aug-2022 13:12:04.717 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [90] ms
08-Aug-2022 13:12:04.733 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
08-Aug-2022 13:12:04.767 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [1728] milliseconds
Last, I check the Docker logs shows me what I did inside the container, but no other information.
Please assist.
Your docker run command does not launch Tomcat but simply bash. Notice the last argument
docker run --name tomcatTest -it gitlab-registry.gs.mil/gets-development/docker/tomcat9-test:latest /bin/bash
change it into
docker run --name tomcatTest gitlab-registry.gs.mil/gets-development/docker/tomcat9-test:latest
If you want a shell to investigate what is going on inside a running container, use
docker exec -it tomcatTest /bin/bash
When we run a new docker container using docker run command we can see the output of the containing service. But when we use docker start to start the same container when it is stopped, it prints just the name of the container, not the output.
How can I start a stopped container with displaying the output?
Example:
docker run
$ docker run -p 8080:8080 --name tomcat_daemon tomcat:latest
26-Apr-2020 06:03:27.747 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.53
26-Apr-2020 06:03:27.750 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 11 2020 10:01:39 UTC
26-Apr-2020 06:03:27.751 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.53.0
26-Apr-2020 06:03:27.752 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
26-Apr-2020 06:03:27.753 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.19.76-linuxkit
26-Apr-2020 06:03:27.754 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
...
docker start
$ docker start tomcat_daemon
tomcat_daemon
Try docker start -i my_container
--interactive , -i Attach container’s STDIN
Reference: https://docs.docker.com/engine/reference/commandline/start/
Background: I have a system behind a proxy/firewall. I can access docker to pull images, but do not have a username/password to access any other sites. Therefore my docker container of sonarqube is essentially offline.
Question: The docker container starts fine the first time, but fails to restart. This happens in two instances, either a manually installed plugin presents an error that it fails to download the update-center url, or it simply starts shutting down immediately as it starts. Both fail the application which closes the container. I do not seem to be able (or understand how to) modify the sonar.properties to get the update-center disabled and need guidance.
I have inquired on the github for the container without much help: https://github.com/SonarSource/docker-sonarqube/issues/76#issuecomment-364563967 The '-Dsonar.updatecenter.activate=false' option does not work when I try it.
Simply shutting down
2018.02.09 21:45:38 INFO ce[][o.s.p.ProcessEntryPoint] Starting ce
2018.02.09 21:45:38 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] no modules loaded
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2018.02.09 21:45:39 INFO ce[][o.e.p.PluginsService] loaded plugin org.elasticsearch.transport.Netty4Plugin]
2018.02.09 21:45:41 INFO ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.02.09 21:45:41 INFO ce[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://pgsonar:5432/sonar
2018.02.09 21:45:43 INFO ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2018.02.09 21:45:43 INFO ce[][o.s.c.c.CePluginRepository] Load plugins
2018.02.09 21:45:45 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Sun Aug 13 21:45:45 UTC 2017
2018.02.09 21:45:45 INFO ce[][o.s.ce.app.CeServer] Compute Engine is operational
2018.02.09 21:45:45 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.02.09 21:45:45 INFO app[][o.s.a.SchedulerImpl] SonarQube is up
2018.02.09 21:47:12 INFO app[][o.s.a.SchedulerImpl] Stopping SonarQube
2018.02.09 21:47:13 INFO ce[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:13 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopping...
2018.02.09 21:47:13 INFO ce[][o.s.c.t.CeProcessingSchedulerImpl] Waiting for workers to finish in-progress tasks
2018.02.09 21:47:14 INFO ce[][o.s.ce.app.CeServer] Compute Engine is stopped
2018.02.09 21:47:15 INFO app[][o.s.a.SchedulerImpl] Process [ce] is stopped
2018.02.09 21:47:15 INFO web[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.02.09 21:47:18 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.02.09 21:47:18 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
chown: cannot access '/opt/sonarqube/temp/README.txt': No such file or directory
Will update with the fail to download later (no access to logs at this exact moment)
Regarding the README.txt issue, you have to create a volume and mount the temp folder (note that I use the postgres setup from anorak:girl). You can then start and stop with no problems.
sudo docker volume create sonarqube-temp
sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure' -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts
Regarding the UpdateCenter issue, workaround is to specify a configuration with the run command (this is specific to Godin's docker container for sonarqube - through his run.sh script):
sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure' -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts -Dsonar.updatecenter.activate=false
I have run docker tomcat 8 on ubuntu 16.04 LTS and Docker version 1.12.0
$ docker run -it --rm -p 8080:8080 tomcat:8.0
Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME:
/usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using
JRE_HOME: /usr/lib/jvm/java-7-openjdk-amd64/jre Using
CLASSPATH:
/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
18-Dec-2016 09:53:03.958 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:
Apache Tomcat/8.0.39
18-Dec-2016 09:53:03.960 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:
Nov 9 2016 08:48:39 UTC
18-Dec-2016 09:53:03.960 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:
8.0.39.0
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:
Linux
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:
4.4.0-31-generic
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:
amd64
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:
/usr/lib/jvm/java-7-openjdk-amd64/jre
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
1.7.0_111-b01
18-Dec-2016 09:53:03.961 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
Oracle Corporation
18-Dec-2016 09:53:03.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
/usr/local/tomcat
18-Dec-2016 09:53:03.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
/usr/local/tomcat
18-Dec-2016 09:53:03.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument:
-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
18-Dec-2016 09:53:03.962 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument:
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djdk.tls.ephemeralDHKeySize=2048
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument:
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djava.endorsed.dirs=/usr/local/tomcat/endorsed
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dcatalina.base=/usr/local/tomcat
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dcatalina.home=/usr/local/tomcat
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
18-Dec-2016 09:53:03.963 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded
APR based Apache Tomcat Native library 1.2.10 using APR version 1.5.1.
18-Dec-2016 09:53:03.964 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR
capabilities: IPv6 [true], sendfile [true], accept filters [false],
random [true].
18-Dec-2016 09:53:03.967 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL
successfully initialized (OpenSSL 1.1.0c 10 Nov 2016)
18-Dec-2016 09:53:04.067 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
["http-apr-8080"]
18-Dec-2016 09:53:04.080 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
["ajp-apr-8009"]
18-Dec-2016 09:53:04.084 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in
690 ms
18-Dec-2016 09:53:04.118 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting
service Catalina
18-Dec-2016 09:53:04.118 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
Engine: Apache Tomcat/8.0.39
18-Dec-2016 09:53:04.129 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory /usr/local/tomcat/webapps/ROOT
18-Dec-2016 09:53:04.656 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of
web application directory /usr/local/tomcat/webapps/ROOT has finished
in 527 ms
18-Dec-2016 09:53:04.657 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory /usr/local/tomcat/webapps/host-manager
18-Dec-2016 09:53:04.732 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of
web application directory /usr/local/tomcat/webapps/host-manager has
finished in 76 ms
18-Dec-2016 09:53:04.733 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory /usr/local/tomcat/webapps/examples
18-Dec-2016 09:53:05.177 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of
web application directory /usr/local/tomcat/webapps/examples has
finished in 444 ms
18-Dec-2016 09:53:05.177 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory /usr/local/tomcat/webapps/manager
18-Dec-2016 09:53:05.218 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of
web application directory /usr/local/tomcat/webapps/manager has
finished in 41 ms
18-Dec-2016 09:53:05.219 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory /usr/local/tomcat/webapps/docs
18-Dec-2016 09:53:05.245 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of
web application directory /usr/local/tomcat/webapps/docs has finished
in 26 ms
18-Dec-2016 09:53:05.250 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["http-apr-8080"]
18-Dec-2016 09:53:05.259 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["ajp-apr-8009"]
18-Dec-2016 09:53:05.260 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1175 ms
and checked directory to /usr/local/tomcat but there is no the directory, where is the tomcat directory ?
According to official Tomcat image documentation (On DockerHub), Tomcat location is indeed /usr/local/tomcat.
I've executed docker run -it --rm -p 8080:8080 tomcat:8.0 /bin/bash and I can confirm this is true. Please try executing the above command and check the results.
FYI, adding /bin/bash at the end of the docker-run command will execute BASH inside the container and let you interact with its contents.