getting while running GOCD docker container in QNAP

I am trying to run gocd docker container ( on QNAP (TS-451 x86 based, firmware 4.2.0) in container station.

container doesn’t’ start and bombs out with

  • Use data of docker container inside another
  • What docker commands does rancher run when I perform an upgrade
  • DB2 data source for a liberty java application
  • How to limit aws instance ip range generated by ec2-instance create cli script?
  • Disable AppArmor for Docker for ptrace_scope
  • Connecting to a running Erlang application release in a docker container
  • May 21 20:21:28 gocd-server-1 syslog-ng[16]: syslog-ng starting up; version='3.5.3'                                                                              
    using default settings from /etc/default/go-server                                                                                                               
    ERROR: Failed to start Go server. Please check the logs.                                                                                                         
    java.lang.RuntimeException: gocd-server-1: gocd-server-1                                                                                                         
            at com.thoughtworks.go.util.ExceptionUtils.bomb(                                                                                  
            at com.thoughtworks.go.server.util.GoSslSocketConnector.getHostname(                                                       
            at com.thoughtworks.go.server.util.GoSslSocketConnector.storeX509Certificate(                                               
            at com.thoughtworks.go.server.util.GoSslSocketConnector.sslConnector(                                                       
            at com.thoughtworks.go.server.util.GoSslSocketConnector.<init>(                                                             
            at com.thoughtworks.go.server.Jetty9Server.sslConnector(                                                                           
            at com.thoughtworks.go.server.Jetty9Server.configure(                                                                               
            at com.thoughtworks.go.server.GoServer.configureServer(                                                                                 
            at com.thoughtworks.go.server.GoServer.startServer(                                                                                     
            at com.thoughtworks.go.server.GoServer.go(                                                                                              
            at com.thoughtworks.go.server.util.GoLauncher.main(                                                                                   
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                           
            at sun.reflect.NativeMethodAccessorImpl.invoke(                                                                         
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(                                                                 
            at java.lang.reflect.Method.invoke(                                                                                                      
            at com.simontuffs.onejar.Boot.main(                                                                                                        
    Caused by: gocd-server-1: gocd-server-1                                                                                           
            at com.thoughtworks.go.server.util.GoSslSocketConnector.getHostname(                                                       
            ... 15 more                                                                                                                                              
    Caused by: gocd-server-1                                                                                                          
            at Method) 

    I checked /etc/hosts inside the container – it includes correct host mapping : gocd-server-1       localhost
    ::1     localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters gocd-server-1
    hostname resovles correctly:
    root@gocd-server-1:/tmp# hostname

    the container image is fine – I have run exactly the same gocd docker container on vagrant Ubuntu vm without any issues

    so the issue is somehow related to QNAP Linux (which seems to be Ubuntu 4.1.2)

    [~] # cat /proc/version
    Linux version 3.12.6 (root@NasX86-12) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Fri Mar 11 02:20:16 CST 2016)

    any ideas how to get around exception?

  • How to select file to copy based on Docker environment variable?
  • How to run docker with experimental functions on Ubuntu 16.04
  • tar: Cannot read: Is a directory in docker
  • Create docker image with php and mysql
  • password define for ssh connection into docker container
  • Upgrade docker-compose to version 3
  • 2 Solutions collect form web for “getting while running GOCD docker container in QNAP”

    To close this thread: though I still don’t understand why this exception happens I think I found the workaround. So if you are the owner of QNAP and want to run GOCD server using ContainerStation the following steps might be useful:
    1. Create a new container, using travix/gocd-server:lastest image ( This container uses JDK8 (instead of JDK7 as official gocd container) plus it includes more options to configure (if you go to advanced settings while creating a container in ContainerStation).
    2. Start the container – you will get the exception – Caused by:

    Why? no idea, I am pretty sure my /etc/hosts settings are correct. In fact I know they are correct.

    1. next step – keep the container running but ssh to your QNAP:

      ssh admin@ (in my case – change ip of the box to yours)

      // check what images are running:
      docker ps -a

    dde6ce028868 travix/gocd-server:latest “/docker-entrypoint.s” 21 hours ago Up 21 hours>8153/tcp,>8154/tcp gocd

    // ssh into the container  
    docker exec -it dde6ce028868 bash
    // run go-server start script 

    let it run, in my case it successfully started gocd.

    1. clean up work dir
      rm -rf /var/lib/go-server/work/

    2. and now restart the container from ContainerStation

    in my case it starts up correctly without unknown host exceptions

    any theories why? (DNS caching, permissions, some initialisations which silently fail?)

    it turned out the issue is related to ACL which gives read access to /etc/hosts and /etc/resolv.conf only to root. So java application running inside the container under a different user, can’t access these files.

    pls. see this discussion for more information:.

    why am I getting permission denied on file with read permissions inside Docker container?

    if you want to use GOCD with QNAP – you might try to use this container

    which includes the following fix:

    # modify ACL so go user would have read access
    # to /etc/hosts and /etc/resolv.conf
    # this is to avoid HostUnknown exception which happends
    # when the gocd container is used on QNAP with ContainerStation
    setfacl -m user:${USER_ID}:r /etc/resolv.conf
    setfacl -m user:${USER_ID}:r /etc/hosts
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.