Skip to content

Instantly share code, notes, and snippets.

@lhriley
Last active March 8, 2018 20:06
Show Gist options
  • Select an option

  • Save lhriley/3cf8bee129f643bfda76d5219f63aa5a to your computer and use it in GitHub Desktop.

Select an option

Save lhriley/3cf8bee129f643bfda76d5219f63aa5a to your computer and use it in GitHub Desktop.
Wait for docker container, then watch logs
#!/bin/bash
service="CONTAINER_NAME"; echo "waiting for docker container '${service}' "; while [[ ! $(docker ps | grep "${service}") ]]; do echo -n "."; sleep 1; done; docker logs -f $(docker ps -a | grep "${service}" | head -n1 | awk '{print $1}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment