How to do it

We proceed with the recipe as follows:

  1. First query Docker for running containers:
$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES308a02f0e1a5 docker.elastic.co/elasticsearch/elasticsearch:6.1.1 "/usr/local/bin/do..." 7 seconds ago Up 6 seconds 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp romantic_kowalevski094a13838376 rabbitmq:3-management "docker-entrypoint..." 47 hours ago Up 47 hours 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp dreamy_easley
  1. Let's  stop the Elasticsearch container. To stop a container, we use docker stop <container-id>. Elasticsearch has a container ID of 308a02f0e1a5. The following stops the container 
$ docker stop 3030

To acknowledge ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.