Starting and stopping App Engine instances using Docker

I created the App Engine project locally using Docker (on OSX) and started the server using the regular gcloud preview app app.yaml command. From what I can say, this allows you to create new images over and over again. After an hour or so of work, I get something like 30 images of dockers, each of which takes 130 MB.

In the end, they told me that I can no longer communicate with localhost: 8080. I tried to kill all containers and images, but still cannot use localhost: 8080 until I reboot.

Looks like I'm not using Docker / gcloud correctly. Does anyone have an idea what can I do wrong? Is there any other way that I have to restart the App Engine instances other than the C command and run the run command again?

UPDATE: after I got closer, I noticed that I get this message when I launch the application locally and the container is created: "http: Hijack is not compatible using CloseNotifier". I'm not familiar enough with Docker to understand what is happening here. All the search queries seem to point to Go, which I am not using.

UPDATE 2: Here is the track:

Creating container... INFO 2015-05-05 02:23:28,293 containers.py:560] Container 1564ce4344957114312d6d1dc696ffbb4176b40ace6dcff5e4239e13ee04a8f6 created. Exception in thread Thread-2: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "/Users/judeosborn/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 643, in _ListenToLogs for line in log_lines: File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 225, in _multiplexed_response_stream_helper socket = self._get_raw_response_socket(response) File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 167, in _get_raw_response_socket self._raise_for_status(response) File "/Users/judeosborn/google-cloud-sdk/./lib/docker/docker/client.py", line 119, in _raise_for_status raise errors.APIError(e, response, explanation=explanation) APIError: 500 Server Error: Internal Server Error ("http: Hijack is incompatible with use of CloseNotifier") INFO 2015-05-05 02:23:28,606 module.py:1745] New instance for module "default" serving on: http://localhost:8080 
+6
source share
2 answers

There is currently a problem with Docker 1.6.x [ link ], which prevents gcloud from gcloud with managed virtual machines (as you seem to be using). The simplest solution to the problem until it is fixed is to downgrade Docker on your development machine to version 1.5.0, which is the latest version that is known to work.

For Ubuntu, you can do something like:

$ curl -sSL https://get.docker.com/ubuntu | sed 's/lxc-docker/lxc-docker-1.5.0/' | sudo sh

For other Linux distributions, you may need to modify this sed pattern.


On the other hand, if you use Boot2Docker on Mac OS X, follow these steps:

  • Completely remove the previous Boot2Docker / Docker setting; have a good guide here
  • Reinstall Boot2Docker / Docker the following instructions here . IMPORTANT You MUST stop right after the installation of “Install Boot2Docker” and before “Run the Boot2Docker Application”. Once you get there, open a terminal and run the following commands:
 $ mkdir ~/.boot2docker $ echo 'ISOURL="https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso"' > ~/.boot2docker/profile 

At this point, you can continue with "Starting the Boot2Docker Application" and complete the installation. You should now have a functioning Docker Launcher from which you can launch managed virtual machines. It would be nice to verify that you have the correct versions installed by release:

$ boot2docker ssh docker version | egrep "(Client|Server) version"

The result should look like this:

Client version: 1.5.0 Server version: 1.5.0

Now you can try your original command again:

$ gcloud preview app run app.yaml

+6
source

Try to run: $ ps uax | egrep "gcloud|appserver" $ ps uax | egrep "gcloud|appserver" If you see something running, kill this ... you may only need kill -9 .

+1
source

Source: https://habr.com/ru/post/986475/


All Articles