Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active October 31, 2015 19:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garystafford/0c8edbfb6655e6e16ae9 to your computer and use it in GitHub Desktop.
Save garystafford/0c8edbfb6655e6e16ae9 to your computer and use it in GitHub Desktop.
Clean-up script to start 'Dockerized' MEAN application, using Fig. (post: http://wp.me/p1RD28-1ja)
#!/bin/sh
# Clean-up / start-up script for Docker/Fig and MEAN app
# Gary A. Stafford
# https://github.com/garystafford
# remove all exited containers
echo "Removing all 'Exited' containers..."
docker rm -f $(docker ps --filter 'status=Exited' -a) > /dev/null 2>&1
# remove all <none> images
echo "Removing all untagged (<none>) images..."
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") > /dev/null 2>&1
# build and start containers with fig
fig build && fig up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment