Dockercompose for guacamole not working

Hi,

I’m trying to start a guacamole docker container via a docker-compose file:

version: '3'
services:
  virtual-desktop-db:
    hostname: virtual-desktop-gtw
    image: mysql:5.7
    restart: always
    volumes:
       - virtual-desktopdb-vol:/var/lib/mysql
       - virtual-desktopdbBackup-vol:/docker-entrypoint-initdb.d
    environment:
      MYSQL_ROOT_PASSWORD: mypass
      MYSQL_DATABASE: guacamole_db
    ports:
      - 3366:3306
    networks:
      - virtual-desktop-net
  virtual-desktop-gtw:
    hostname: virtual-desktop-gtw
    image: guacamole/guacd
    restart: always
    ports:
      - 4822:4822
    networks:
      - virtual-desktop-net
  virtual-desktop-ui:
    hostname: virtual-desktop-ui
    depends_on:
      - virtual-desktop-gtw
      - virtual-desktop-db
    links:
      - virtual-desktop-gtw
      - virtual-desktop-db
    image: guacamole/guacamole
    restart: always
    environment:
      MYSQL_HOSTNAME: virtual-desktop-db
      MYSQL_DATABASE: guacamole_db
      MYSQL_USER: root
      MYSQL_PASSWORD: mypass
      MYSQL_PORT: 3366
      GUACD_HOSTNAME: virtual-desktop-gtw
      GUACD_PORT: 4822
    ports:
      - 8181:8080
    networks:
      - virtual-desktop-net
networks:
  virtual-desktop-net:
volumes:
  virtual-desktopdb-vol:
  virtual-desktopdbBackup-vol:

Once started, the interface is empty and I get the following error message with the docker log command on the virtual-desktop-ui container only:

06-Jul-2018 21:44:20.082 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Jul-2018 21:44:20.085 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 9281 ms
21:44:22.717 [http-nio-8080-exec-4] ERROR o.a.g.rest.RESTExceptionWrapper - Unexpected internal error:
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
### The error may exist in org/apache/guacamole/auth/jdbc/user/UserMapper.xml
### The error may involve org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
### The error occurred while executing a query
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
06-Jul-2018 21:44:22.726 SEVERE [http-nio-8080-exec-4] com.sun.jersey.spi.container.ContainerResponse.logException Mapped exception to response: 500 (Internal Server Error)
 org.apache.guacamole.rest.APIException
        at org.apache.guacamole.rest.RESTExceptionWrapper.invoke(RESTExceptionWrapper.java:202)
        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:497)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Please note that I could get it working via the following docker command lines:

docker run --name some-guacd -d -p 4822:4822 guacamole/guacd
docker run -d -it --name some-mysql -e MYSQL_ROOT_PASSWORD=mypass -p 3366:3306 mysql:5.7
docker run --name some-guacamole --link some-guacd:guacd --link some-mysql:mysql -d -p 8181:8080 -e MYSQL_PORT=3366 -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=root -e MYSQL_PASSWORD=mypass guacamole/guacamole

In order to make the deployment automatic, I want to make it working with docker-compose file.

Good Night

hi,
If you have a solution can you post a comment a solution please.
I am stuck creating compose file with docker.

Hi,
I have noticed other problems with other applications when using docker compose.
So I’m using docker commands in bash scripts and it works fine.
As information here are the actual 3 commands I use for guacamole:

docker run -d -it --name virtual-desktop-db -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=databasepasswordhere -e MYSQL_ROOT_PASSWORD=databasepasswordhere --volume=virtual-desktopdbBackup-vol:/docker-entrypoint-initdb.d --volume=virtual-desktopdb-vol:/var/lib/mysql --restart=always --hostname=virtual-desktop-db mysql:5.7
docker run -d -it --name virtual-desktop-gtw --restart=always --hostname=virtual-desktop-gtw guacamole/guacd
docker run -d -it --name virtual-desktop-ui --link virtual-desktop-gtw:guacd --link virtual-desktop-db:mysql -e MYSQL_HOSTNAME=virtual-desktop-db -e MYSQL_DATABASE=guacamole_db -e MYSQL_USER=guacamole_user -e MYSQL_PASSWORD=databasepasswordhere -e MYSQL_PORT=3366 --volume=virtual-desktopui-vol:/usr/local/tomcat/webapps --restart=always --hostname=virtual-desktop-ui guacamole/guacamole