Giter Site home page Giter Site logo

gocd-docker's Introduction

gocd-docker's People

Contributors

alan-mushi avatar arvindsv avatar atjones0011 avatar flosell avatar fredrikwendt avatar jfklingler avatar jskswamy avatar jyotisingh avatar ketan avatar macat avatar pedrocarrico avatar rajiesh avatar russellwstanley avatar sennerholm avatar tomzo avatar tpbrown avatar varshavaradarajan avatar zabil avatar

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

gocd-docker's Issues

/etc/default/go-agent template is not replaced on run

For some reason we still have something like

GO_SERVER_URL=https://go-server:8154/go/

in /etc/default/go-agent when the agent is started.
And so the supplied GO_SERVER_URL is not used but instead stays as go-server.

The log shows confirms:

*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 8
Starting Go Agent to connect to server go-server ...
[Wed Jan 11 10:59:31 UTC 2017] using default settings from /etc/default/go-agent
logFile Environment Variable= null
Logging to go-agent-bootstrapper.log
0 [TouchLoopThread-2] INFO com.thoughtworks.go.agent.launcher.Lockfile  - Using lock file: /var/lib/go-agent/.agent-bootstrapper.running
Jan 11 10:59:31 gocd-agent-11-s7ma4 syslog-ng[15]: syslog-ng starting up; version='3.5.3'
493 [main] ERROR com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - Couldn't update admin/agent-launcher.jar. Sleeping for 1m. Error: 
java.net.UnknownHostException: go-server: Name or service not known
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1269)
	at java.net.InetAddress.getAllByName(InetAddress.java:1185)
	at java.net.InetAddress.getAllByName(InetAddress.java:1119)
	at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:111)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
	at com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.fetchUpdateCheckHeaders(ServerBinaryDownloader.java:100)
	at com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.downloadIfNecessary(ServerBinaryDownloader.java:75)
	at com.thoughtworks.go.agent.launcher.AgentLauncherImpl.launch(AgentLauncherImpl.java:78)
	at com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.go(AgentBootstrapper.java:77)
	at com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.main(AgentBootstrapper.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.simontuffs.onejar.Boot.run(Boot.java:306)
	at com.simontuffs.onejar.Boot.main(Boot.java:159)

Somehow this line https://github.com/gocd/gocd-docker/blob/master/phusion/agent/go-agent-start.sh#L10 fails or is not run...

Could setuser tool run a service like a login user?

I use gocd agent to build a CI machine demo, and found it uses setuser tool to run CI service with a seperated user, for example 'testci'. My application is a Rails app. The CI server needs a ruby env to run each test. I have installed rvm for user 'testci', and use these commands to check, the ruby env is OK:

(I use docker compose, docker name is 'ci')

docker-compose run ci bash
su - testci
ruby -v

output is 'ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]', ruby does works.

But the problem is when the CI run each test, it always can't found ruby. Because the rvm config is be written in .bash_profile, a logined user can read it correctly so all ok, I guess setuser tool maybe didn't read .bash_profile then ruby not works.

Did I missed or ignored something? and I want to know the setuser tool can run a service like a real logined user?

In fact, my problem is how to add the ruby env in gocd agent correctly?

Server does not start with empty mounted directories (/var/lib/go-server /var/log/ ...etc)

ubuntu@ubuntu-xenial:~/dev-env-setup$ docker logs -f linux_gocd-server_1
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 7
Starting Go Server ...
[Thu Jun 16 09:41:55 UTC 2016] using default settings from /etc/default/go-server
/usr/share/go-server/server.sh: line 180: /var/log/go-server/go-server.out.log: Permission denied
/usr/share/go-server/server.sh: line 181: /var/log/go-server/go-server.out.log: Permission denied
Jun 16 09:41:55 82e1892ae7d1 syslog-ng[15]: syslog-ng starting up; version='3.5.3'
Error trying to validate file agent-bootstrapper.jar: java.io.FileNotFoundException: /var/lib/go-server/agent-bootstrapper.jar (Permission denied)
Error trying to validate file agent.jar: java.io.FileNotFoundException: /var/lib/go-server/agent.jar (Permission denied)
Error trying to validate file agent-launcher.jar: java.io.FileNotFoundException: /var/lib/go-server/agent-launcher.jar (Permission denied)
Error trying to validate file cruise.war: java.io.FileNotFoundException: /var/lib/go-server/cruise.war (Permission denied)
Error trying to validate file historical_jars/h2-1.2.127.jar: java.io.FileNotFoundException: /var/lib/go-server/historical_jars/h2-1.2.127.jar (No such file or directory)
Error trying to validate file cruise-config.xml: java.io.FileNotFoundException: /etc/go/cruise-config.xml (Permission denied)
Error trying to validate file config.properties: java.io.FileNotFoundException: /etc/go/config.properties (Permission denied)
Error trying to validate file cruise-config.xsd: java.io.FileNotFoundException: /etc/go/cruise-config.xsd (Permission denied)
Error trying to validate file jetty.xml: java.io.FileNotFoundException: /etc/go/jetty.xml (Permission denied)
Error trying to validate file go_update_server.pub: java.io.FileNotFoundException: /etc/go/go_update_server.pub (Permission denied)
/var/lib/go-server/db/h2deltas/2_create_indexes.sql (No such file or directory)
/var/lib/go-server/db/h2db/cruise.h2.db (No such file or directory)
Error trying to validate file log4j.properties: java.io.FileNotFoundException: /etc/go/log4j.properties (Permission denied)
== Thu Jun 16 09:42:26 UTC 2016: Waiting for Go Server dashboard to be accessible ...
Error starting Go Server.
== Thu Jun 16 09:42:56 UTC 2016: Waiting for Go Server dashboard to be accessible ...
== Thu Jun 16 09:43:27 UTC 2016: Waiting for Go Server dashboard to be accessible ...
== Thu Jun 16 09:43:57 UTC 2016: Waiting for Go Server dashboard to be accessible ...
== Thu Jun 16 09:44:28 UTC 2016: Waiting for Go Server dashboard to be accessible ...

Is there no way to do this without copying the files from inside the container?

gocd-server and gocd-agent missing hg binary

Out of the box, GoCD supports Git and Mercurial source code repositories. However, the latest versions of the docker images doesn't contain a hg binary, so in practice Mercurial repos can't be used out of the box.

gocd-server VOLUME /var/go makes no sense

TL;DR
Remove /etc/go/ and /var/go from gocd-server Dockerfile.gocd-server as in it's current state it doesn't allow use of gocd/gocd-server as a base image which can be configured (e.g., cruise-config.xml, ssh keys for go user, etc.)

I imagine the sorts of files one would put into /var/go would be configuration related. For example, I am using the GoCD SCM plugin for GitHub. For GoCD to pull code from GitHub you have to have a private key in the gocd-server Docker container. As the server is running as the unix go user the logical location is /var/go/.ssh/id_rsa with the public half of the key pair in GitHub. The typical ways you would get the private key into the gocd-server docker image or container are as follows:

  1. docker run -d -v id_rsa:/var/go/.ssh/id_rsa gocd/gocd-server
  2. Build a custom image FROM gocd/gocd-server with the private key copied into position

Option one will not work as the owner of /var/go/.ssh/id_rsa will be root. Option two gives us the flexibility of changing the id_rsa owner and permission (i.e, go user owned and 600) so SSH works correctly. But this line from Dockerfile.gocd-server is causing issues:

VOLUME ["/var/lib/go-server", "/var/log/go-server", "/etc/go", "/go-addons", "/var/go"]

Docker data volumes are intended for data not configs which often need to be dynamically modified. Here is an example of what happens if you try to use gocd/gocd-server as a base image and modify /var/go

FROM gocd/gocd-server:16.1.0

RUN mkdir /var/go/.ssh \
    && ls -al
$ docker version
Client:
 Version:      1.8.3
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   cedd534-dirty
 Built:        Tue Feb  2 13:28:10 UTC 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.3
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   cedd534-dirty
 Built:        Tue Feb  2 13:28:10 UTC 2016
 OS/Arch:      linux/amd64

$ docker build -t foo .
Sending build context to Docker daemon 10.24 kB
Step 1 : FROM gocd/gocd-server:16.1.0
 ---> f9088466c94b
Step 2 : RUN mkdir /var/go/.ssh     && ls -al /var/go/
 ---> Running in 07ccb25529ea
total 48
drwxr-xr-x.  3 go   go   4096 Feb 13 00:07 .
drwxr-xr-x. 12 root root 4096 Feb 12 22:52 ..
-rw-r--r--.  1 go   go    220 Apr  9  2014 .bash_logout
-rw-r--r--.  1 go   go   3637 Apr  9  2014 .bashrc
-rw-r--r--.  1 go   go    675 Apr  9  2014 .profile
drwxr-xr-x.  2 root root 4096 Feb 13 00:07 .ssh
 ---> 829bb624192e
Removing intermediate container 07ccb25529ea
Successfully built 829bb624192e

$ docker run -it --rm foo bash
root@70e85e684ff2:/tmp# ls -al /var/go/
total 40
drwxr-xr-x.  2 go   go   4096 Feb 13 00:07 .
drwxr-xr-x. 12 root root 4096 Feb 12 22:52 ..
-rw-r--r--.  1 go   go    220 Apr  9  2014 .bash_logout
-rw-r--r--.  1 go   go   3637 Apr  9  2014 .bashrc
-rw-r--r--.  1 go   go    675 Apr  9  2014 .profile

Allow just the files and directories that need to survive a docker restart to be mounted for easy upgrade

I mount the following paths when running gocd-server as a docker container

/var/log/go-server
/var/lib/go-server/pipelines/flyweight
/var/lib/go-server/plugins
/var/lib/go-server/artifacts
/var/lib/go-server/db
/etc/go
/var/go/.ssh

To be able to kill and restart the docker container without losing database and configuration and not having to check out all flyweights again.

The first time the docker container runs it creates files in the host directories these volumes are mounted to and it skips it the next time, so they're not overwritten. So that works fine. But it's in the way of doing a quick update from one to the next version by just running a newer docker image.

For example I'd rather just mount /var/lib/go-server/db/h2db instead of /var/lib/go-server/db, but then all the other directories in /var/lib/go-server/db/ aren't created and Go doesn't start properly.

And when mounting the whole /var/lib/go-server/db/ directory as I do now it will not update to the latest h2deltas when running a newer image.

All in all there seems to be quite some work around making the docker image easy to use for upgrading versions and for controlling the full configuration through environment variables.

Allow ports for server and agents to be set using environment variables

Would be useful to be able to set the following environment variables to control the ports the docker container uses internally.

GO_SERVER_PORT
GO_SERVER_SSL_PORT

The current containers always use the values in /etc/default/go-server or /etc/default/go-agent. Those files should check if the environment variables aren't set already and then use those.

Or is there an alternative to running /sbin/my_init in order to provide those environment variables yourself?

gocd-agent Auto Register not working

Tried setting agent auto register properties a few ways with the 16.1.0 image but nothing is working. Running docker engine 1.9.1.

Here is an example of building an image from gocd/gocd-agent:16.1.0 with a properties files, but somehow the agent is removing the properties file.

# Basic Docker files for this experiment
$ ls -1
Dockerfile
autoregister.properties
docker-compose.yml

$ cat autoregister.properties
agent.auto.register.key=23456789abcdef

$ cat docker-compose.yml
gocd-agent-test:
  build: .
  restart: always
  container_name: gocd-agent-test
  environment:
     - GO_SERVER=gocd.efp.local
  ports:
     - 8153:8153
     - 8154:8154

$ cat Dockerfile
FROM gocd/gocd-agent:16.1.0

COPY autoregister.properties /var/lib/go-agent/config/autoregister.properties
RUN chown go:go /var/lib/go-agent/config/autoregister.properties

# I use docker-compose to run a build
$ docker-compose build
Building gocd-agent-test
Step 1 : FROM gocd/gocd-agent:16.1.0
 ---> 0aada6d4d4f9
Step 2 : COPY autoregister.properties /var/lib/go-agent/config/autoregister.properties
 ---> b46ba3316b82
Removing intermediate container 995c1663ea46
Step 3 : RUN chown go:go /var/lib/go-agent/config/autoregister.properties
 ---> Running in 31c4d255c23b
 ---> 6a4d26762ece
Removing intermediate container 31c4d255c23b
Successfully built 6a4d26762ece

# The resultant image from the build
$ docker images
REPOSITORY                                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
efpvoltrongocdagentdind_gocd-agent-test   latest              6a4d26762ece        2 minutes ago       455.5 MB
gocd/gocd-agent                           16.1.0              0aada6d4d4f9        3 weeks ago         455.5 MB
docker/compose                            1.5.2               a1614be747d3        10 weeks ago        58.6 MB

# If I run the container I just built the properties file exists
$ docker run -it --rm efpvoltrongocdagentdind_gocd-agent-test bash
root@14bdfe14c2df:/tmp# cat /var/lib/go-agent/config/autoregister.properties
agent.auto.register.key=23456789abcdef
root@14bdfe14c2df:/tmp# exit
exit

# Now I run the container in daemon mode
$ docker-compose up -d && docker logs -f gocd-agent-test
Creating gocd-agent-test
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 7
Starting Go Agent to connect to server gocd.efp.local ...
tail: unrecognized file system type 0x794c7630 for ‘/var/log/syslog’. please report this to [email protected]. reverting to polling
[Sat Feb 13 06:20:07 UTC 2016] using default settings from /etc/default/go-agent
logFile Environment Variable= null
Logging to go-agent-bootstrapper.log
0 [TouchLoopThread-2] INFO com.thoughtworks.go.agent.launcher.Lockfile  - Using lock file: /var/lib/go-agent/.agent-bootstrapper.running
194 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - download started at Sat Feb 13 06:20:07 UTC 2016
201 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - got server response at Sat Feb 13 06:20:07 UTC 2016
431 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - pipe the stream to admin/agent at Sat Feb 13 06:20:08 UTC 2016
436 [main] INFO com.thoughtworks.go.util.PerfTimer  - Performance: Downloading new admin/agent with md5 signature: WF19vAJ7DYffVfYO6yT19A== took 245ms
438 [main] INFO com.thoughtworks.go.agent.common.util.JarUtil  - Attempting to load Go-Agent-Bootstrap-Class from agent.jar File:
439 [main] INFO com.thoughtworks.go.agent.common.util.JarUtil  - manifestClassKey: Go-Agent-Bootstrap-Class: com.thoughtworks.go.agent.AgentProcessParentImpl
442 [main] INFO com.thoughtworks.go.agent.AgentProcessParentImpl  - Agent is version: 16.1.0
558 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - download started at Sat Feb 13 06:20:08 UTC 2016
564 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - got server response at Sat Feb 13 06:20:08 UTC 2016
580 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - pipe the stream to admin/agent-plugins.zip at Sat Feb 13 06:20:08 UTC 2016
581 [main] INFO com.thoughtworks.go.util.PerfTimer  - Performance: Downloading new admin/agent-plugins.zip with md5 signature: a267a82eacccce310ea197cb02b659c0 took 23ms
586 [main] INFO com.thoughtworks.go.agent.AgentProcessParentImpl  - Launching Agent with command: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dcruise.console.publish.interval=10 -Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom -Dagent.launcher.version=Unknown -Dagent.plugins.md5=a267a82eacccce310ea197cb02b659c0 -Dagent.binary.md5=WF19vAJ7DYffVfYO6yT19A== -Dagent.launcher.md5=e9SXM6cdV5kSkpVEmymHIg== -jar agent.jar https://gocd.efp.local:8154/go/

$ docker ps -a
CONTAINER ID        IMAGE                                     COMMAND             CREATED             STATUS              PORTS                              NAMES
3ce830106a3c        efpvoltrongocdagentdind_gocd-agent-test   "/sbin/my_init"     32 seconds ago      Up 31 seconds       0.0.0.0:8153-8154->8153-8154/tcp   gocd-agent-test

# And exec into it. The properties file is not there.
$ docker exec -it gocd-agent-test bash
root@9b00561cc118:/tmp# ls /var/lib/go-agent/config/autoregister.properties
ls: cannot access /var/lib/go-agent/config/autoregister.properties: No such file or directory

/go:87 - ERROR: error app failed to handle exception: org.jruby.exceptions.RaiseException

Hi All,

Myself using docker images for go-server:15.1.0 and agents:15.1.0, server is keep crashing with following error. Kindly suggest.

2015-07-14 12:22:42,644 ERROR [364105571@qtp-1825851538-1407] /go:87 - ERROR: error app failed to handle exception: org.jruby.exceptions.RaiseException: (NativeException) org.mortbay.jetty.EofException: null
org.jruby.exceptions.RaiseException: (NativeException) org.mortbay.jetty.EofException: null
        at org.mortbay.jetty.AbstractGenerator$Output.write(org/mortbay/jetty/AbstractGenerator.java:633)
        at org.mortbay.jetty.AbstractGenerator$Output.write(org/mortbay/jetty/AbstractGenerator.java:590)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
        at RUBY.write_body(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:172)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
        at RUBY.write_body(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:171)
        at RUBY.respond(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:93)
        at JRuby$$Rack$$Response_1309102993.respond(JRuby$$Rack$$Response_1309102993.gen:13)
        at JRuby$$Rack$$Response_1309102993.respond(JRuby$$Rack$$Response_1309102993.gen:13)
        at com.thoughtworks.go.rackhack.DelegatingServlet.service(com/thoughtworks/go/rackhack/DelegatingServlet.java:49)
        at com.thoughtworks.go.rackhack.DelegatingServlet.service(com/thoughtworks/go/rackhack/DelegatingServlet.java:54)
        at org.mortbay.jetty.servlet.ServletHolder.handle(org/mortbay/jetty/servlet/ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler.handle(org/mortbay/jetty/servlet/ServletHandler.java:390)
        at org.mortbay.jetty.security.SecurityHandler.handle(org/mortbay/jetty/security/SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(org/mortbay/jetty/servlet/SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(org/mortbay/jetty/handler/ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(org/mortbay/jetty/webapp/WebAppContext.java:418)
        at org.mortbay.jetty.servlet.Dispatcher.forward(org/mortbay/jetty/servlet/Dispatcher.java:327)
        at org.mortbay.jetty.servlet.Dispatcher.forward(org/mortbay/jetty/servlet/Dispatcher.java:126)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(org/tuckey/web/filters/urlrewrite/NormalRewrittenUrl.java:213)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(org/tuckey/web/filters/urlrewrite/RuleChain.java:171)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(org/tuckey/web/filters/urlrewrite/RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(org/tuckey/web/filters/urlrewrite/UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(org/tuckey/web/filters/urlrewrite/UrlRewriteFilter.java:381)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.web.FlashLoadingFilter.doFilter(com/thoughtworks/go/server/web/FlashLoadingFilter.java:43)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(org/springframework/security/intercept/web/FilterSecurityInterceptor.java:109)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(org/springframework/security/intercept/web/FilterSecurityInterceptor.java:83)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(org/springframework/security/ui/ExceptionTranslationFilter.java:101)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(org/springframework/security/providers/anonymous/AnonymousProcessingFilter.java:105)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.security.UserEnabledCheckFilter.doFilterHttp(com/thoughtworks/go/server/security/UserEnabledCheckFilter.java:64)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(org/springframework/security/ui/AbstractProcessingFilter.java:271)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(org/springframework/security/ui/basicauth/BasicProcessingFilter.java:173)
        at com.thoughtworks.go.server.security.BasicAuthenticationFilter.doFilterHttp(com/thoughtworks/go/server/security/BasicAuthenticationFilter.java:40)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.security.OauthAuthenticationFilter.doFilterHttp(com/thoughtworks/go/server/security/OauthAuthenticationFilter.java:65)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)

Assumption that secure port is 8154

Our gocd server is not running on 8154 and there does not appear to be a way to prevent it from appending that onto the end of the GO_SERVER variable.

tail: cannot open ‘/var/log/go-server/go-server.log’ for reading: No such file or directory

TLDR: go-server.log has moved from /var/log/go-server/ to /var/lib/go-server between 16.7.0 and 16.8.0

docker run gocd/gocd-server:16.8.0

Go Server already running on http://7ccb35b6976c:8153/go
tail: cannot open ‘/var/log/go-server/go-server.log’ for reading: No such file or directory
tail: no files remaining
Starting Go Server ...

Looking inside running container I see that go-server.log now exists in /var/lib/go-server instead.

root@7ccb35b6976c:/tmp# ll /var/lib/go-server/
total 117164
drwxr-xr-x 10 go   go       4096 Aug 24 04:31 ./
drwxr-xr-x 49 root root     4096 Aug 24 04:30 ../
drwxr-xr-x  2 go   go       4096 Aug 24 04:30 addons/
-rw-r--r--  1 go   go    5438324 Aug 24 04:30 agent-bootstrapper.jar
-rw-r--r--  1 go   go    2690481 Aug 24 04:30 agent-launcher.jar
-rw-r--r--  1 go   go   29213632 Aug 24 04:30 agent.jar
drwxr-xr-x  2 go   go       4096 Aug 24 04:31 artifacts/
-rw-r--r--  1 go   go   82558782 Aug 24 04:30 cruise.war
drwxr-xr-x  6 go   go       4096 Aug 24 04:31 db/
drwxr-xr-x  4 go   go       4096 Aug 24 04:31 felix-cache/
-rw-r--r--  1 go   go      25287 Aug 24 04:32 go-server.log
-rw-r--r--  1 go   go          0 Aug 24 04:30 go-shine.log
drwxr-xr-x  2 go   go       4096 Aug 24 04:30 historical_jars/
drwxr-xr-x  4 go   go       4096 Aug 24 04:31 plugins/
drwxr-xr-x  3 go   go       4096 Aug 24 04:31 plugins_work/
drwxr-xr-x  3 go   go       4096 Aug 24 04:30 work/

Docker images for production (gocd server)

Hi,
wouldn't it be easy and useful to enable persistency (volumes) to the docker image(s) so that someone could use it easily for production use case?

At the moment I would take the image as a base image and add the volume functionallity on top of it.

Any suggestion?

Cheers
Simon

ssh key for interaction with git

Both agent and server will need to interact with a remote SCM system, e.g. git/gerrit and hence will need to register a key with that repository. Go application software does not support configuration of ssh key as part of Material config for pipeline.

One work around for this is a server environment is to create ssh key for the go user and register those keys for a go user in the e.g. gerrit system.

What is the view on how this should be delivered for container version? Options would be:

  1. Build ssh key generation into docker image
  2. Check for key at startup and generate if absent.
  3. Add reference to external key url somewhere and add as environment variable
  4. can be done today for agent in "child build" -from gocd/gocd-agent, but not in server as VOLUME command locks down /var/go.
  5. could be done with a a simple check at start of go-server-start.sh

show_msg "Checking for ssh key ..."
if [ ! -f /var/go/.ssh/id_rsa ] || [ ! -f /var/go/.ssh/id_rsa.pub ]; then
show_msg "No ssh key found. Generating ..."
ssh-keygen -t rsa -N "" -f /var/go/.ssh/id_rsa
fi

I suspect there is also possible a third solution using some kind of sidecar container to do do git/gerrit interaction and and act as a data container to the server/agent (but that is beyond my current docker knowledge :-) )

Would a PR for option 2 be acceptable?

getting java.net.UnknownHostException while running gocd/gocd-server on QNAP

hello,

I am trying to run GoCD in Docker on QNAP server.

here is the exception stacktrace

~] # docker run -tiP gocd/gocd-server
*** Running /etc/rc.local...
*** Booting runit daemon...
* Runit started as PID 8
Starting Go Server ...
using default settings from /etc/default/go-server
May 19 19:36:42 454bc5dbade1 syslog-ng[15]: syslog-ng starting up; version='3.5.3'
ERROR: Failed to start Go server. Please check the logs.
java.lang.RuntimeException: 454bc5dbade1: 454bc5dbade1
at com.thoughtworks.go.util.ExceptionUtils.bomb(ExceptionUtils.java:36)
at com.thoughtworks.go.server.util.GoSslSocketConnector.getHostname(GoSslSocketConnector.java:102)
at com.thoughtworks.go.server.util.GoSslSocketConnector.storeX509Certificate(GoSslSocketConnector.java:92)
at com.thoughtworks.go.server.util.GoSslSocketConnector.sslConnector(GoSslSocketConnector.java:56)
at com.thoughtworks.go.server.util.GoSslSocketConnector.(GoSslSocketConnector.java:51)
at com.thoughtworks.go.server.Jetty9Server.sslConnector(Jetty9Server.java:133)
at com.thoughtworks.go.server.Jetty9Server.configure(Jetty9Server.java:76)
at com.thoughtworks.go.server.GoServer.configureServer(GoServer.java:84)
at com.thoughtworks.go.server.GoServer.startServer(GoServer.java:70)
at com.thoughtworks.go.server.GoServer.go(GoServer.java:63)
at com.thoughtworks.go.server.util.GoLauncher.main(GoLauncher.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.simontuffs.onejar.Boot.run(Boot.java:306)
at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.net.UnknownHostException: 454bc5dbade1: 454bc5dbade1
at java.net.InetAddress.getLocalHost(InetAddress.java:1496)
at com.thoughtworks.go.server.util.GoSslSocketConnector.getHostname(GoSslSocketConnector.java:100)
... 15 more
Caused by: java.net.UnknownHostException: 454bc5dbade1
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316)
at java.net.InetAddress.getLocalHost(InetAddress.java:1492)
... 16 more
^C
* Shutting down runit daemon (PID 8)...

any ideas how to make this work?

Regards, Roman

Tag for 16.2.1 on docker hub

There is no tag for 16.2 on docker hub, only latest which seem to be updated the same time as this repo was updated. 16.1.0 was the latest tag.

/go:87 - ERROR: error app failed to handle exception: org.jruby.exceptions.RaiseException

Hi All,

Myself using docker images for go-server:15.1.0 and agents:15.1.0, server is keep crashing with following error. Kindly suggest.

2015-07-14 12:22:42,644 ERROR [364105571@qtp-1825851538-1407] /go:87 - ERROR: error app failed to handle exception: org.jruby.exceptions.RaiseException: (NativeException) org.mortbay.jetty.EofException: null
org.jruby.exceptions.RaiseException: (NativeException) org.mortbay.jetty.EofException: null
        at org.mortbay.jetty.AbstractGenerator$Output.write(org/mortbay/jetty/AbstractGenerator.java:633)
        at org.mortbay.jetty.AbstractGenerator$Output.write(org/mortbay/jetty/AbstractGenerator.java:590)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
        at RUBY.write_body(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:172)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
        at RUBY.write_body(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:171)
        at RUBY.respond(file:/var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/jruby-rack-1.1.14.jar!/jruby/rack/response.rb:93)
        at JRuby$$Rack$$Response_1309102993.respond(JRuby$$Rack$$Response_1309102993.gen:13)
        at JRuby$$Rack$$Response_1309102993.respond(JRuby$$Rack$$Response_1309102993.gen:13)
        at com.thoughtworks.go.rackhack.DelegatingServlet.service(com/thoughtworks/go/rackhack/DelegatingServlet.java:49)
        at com.thoughtworks.go.rackhack.DelegatingServlet.service(com/thoughtworks/go/rackhack/DelegatingServlet.java:54)
        at org.mortbay.jetty.servlet.ServletHolder.handle(org/mortbay/jetty/servlet/ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler.handle(org/mortbay/jetty/servlet/ServletHandler.java:390)
        at org.mortbay.jetty.security.SecurityHandler.handle(org/mortbay/jetty/security/SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(org/mortbay/jetty/servlet/SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(org/mortbay/jetty/handler/ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(org/mortbay/jetty/webapp/WebAppContext.java:418)
        at org.mortbay.jetty.servlet.Dispatcher.forward(org/mortbay/jetty/servlet/Dispatcher.java:327)
        at org.mortbay.jetty.servlet.Dispatcher.forward(org/mortbay/jetty/servlet/Dispatcher.java:126)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(org/tuckey/web/filters/urlrewrite/NormalRewrittenUrl.java:213)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(org/tuckey/web/filters/urlrewrite/RuleChain.java:171)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(org/tuckey/web/filters/urlrewrite/RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(org/tuckey/web/filters/urlrewrite/UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(org/tuckey/web/filters/urlrewrite/UrlRewriteFilter.java:381)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.web.FlashLoadingFilter.doFilter(com/thoughtworks/go/server/web/FlashLoadingFilter.java:43)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(org/springframework/security/intercept/web/FilterSecurityInterceptor.java:109)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(org/springframework/security/intercept/web/FilterSecurityInterceptor.java:83)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(org/springframework/security/ui/ExceptionTranslationFilter.java:101)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(org/springframework/security/providers/anonymous/AnonymousProcessingFilter.java:105)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.security.UserEnabledCheckFilter.doFilterHttp(com/thoughtworks/go/server/security/UserEnabledCheckFilter.java:64)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(org/springframework/security/ui/AbstractProcessingFilter.java:271)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(org/springframework/security/ui/basicauth/BasicProcessingFilter.java:173)
        at com.thoughtworks.go.server.security.BasicAuthenticationFilter.doFilterHttp(com/thoughtworks/go/server/security/BasicAuthenticationFilter.java:40)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(org/springframework/security/util/FilterChainProxy.java:371)
        at com.thoughtworks.go.server.security.OauthAuthenticationFilter.doFilterHttp(com/thoughtworks/go/server/security/OauthAuthenticationFilter.java:65)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(org/springframework/security/ui/SpringSecurityFilter.java:53)

created rancher catalog based on your images

just wanted to mention that i created a catalog file for rancher based on your official images, its located https://github.com/EugenMayer/docker-rancher-extra-catalogs here for now.

Eventhough rancher already had a gocd-server and agent catalog, both do use some private images - why so ever.

Feel free to give me any hints on what options to expose, volume setups and so on, see here:
https://github.com/EugenMayer/docker-rancher-extra-catalogs/blob/master/templates/gocd-server/1/docker-compose.yml

Thanks!

Java 8 (runtime) compatibility

Issue

Plugins that have been compiled using Java 8 byte code (52) as a target won't work with the official GoCD docker image.

Cause

  • The official GoCD Docker Image is based upon an image that still uses OpenJDK 7.
  • It is based upon Ubuntu 14.04 LTS release (which might also be a bit old).

Possible solution

  • Upgrade base Docker image to Ubuntu 16.04 LTS
  • Install OpenJDK 8

Supply custom plugins as startup

It would nice if plugins could be provided as part of the startup instead of copying them after startup.

I can see there is an add-ons directory but that appears to be used for configuring things like the underlying database setup.

Because the folders get created after first startup it makes it difficult to mount a folder. The only options it to extend and use the COPY/RUN commands to put the files in place and then change ownership of the directory tree.

Is there something I have missed? Otherwise I will work on an update to the Dockerfile

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.