Docker Restart Policy Error

20 views
Skip to first unread message

swainn

unread,
May 2, 2016, 1:38:30 PM5/2/16
to Tethys Platform
I usually encounter that error if I'm running a newer version of Docker than is supported by Tethys. You can figure out the Docker version with the following command: 

$ docker --version

I encounter this problem on version 1.6.2, for example. But you probably need a later version of Docker to be able to the run "docker exec" command. So, there are a few options:

(1) If you have the containers already created (aka, you upgraded Docker after initializing the Tethys docker containers) then you could start them using the Docker CLI directly:

$ docker start tethys_geoserver

You can determine if the containers exist by checking if the name of the container (e.g. tethys_geoserver) is in the output of the following command:

$ docker ps -a

(2) If the Docker containers are not already created or if you want to be able to use the Tethys docker CLI, then it gets a bit messier. Browse to : /usr/lib/tethys/src/tethys_apps/cli/ and open docker_commands.py in a text editor. Comment out the three lines that set the restart policy: 

restart_policy='always',

This is a band aid approach, but should allow you to use the newer version of Docker with Tethys. Recognize that if you do this for Dockers being used in a production server, that the restart policy will not be set, meaning if the server restarts, the docker containers will not automatically start up. The real fix would be to find out how to set the restart_policy attribute with the newer versions of Docker.

Nathan


There is a link to a string on the blog. My issue isn't really about that issue so I didn't post my current questions there, but that is what I am trying to do so you can have some background.

I am trying to add the code suggested by Alan to the demo server. It has worked before on the BYU server. On the demo serevr when I run  sudo docker exec -it tethys_geoserver /bin/bash there is an error that the docker isn't running. So I try to start the docker and I get this a mean error 
    raise errors.APIError(e, response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("json: cannot unmarshal string into Go value of type runconfig.RestartPolicy")

I assume this has something with apache server. So this whole thing is really a question of how do I get access to the dockers on the server with apache running (tomcat6 which is not what we are currently using on 1.3 I know).

Curtis

Curtis Rae

unread,
May 2, 2016, 7:48:43 PM5/2/16
to Tethys Platform
+1 This was it! What is officially the version of docker that is supported? Would it be worth getting a different docker version?
Reply all
Reply to author
Forward
0 new messages