Skip to content

Instantly share code, notes, and snippets.

@drstearns
drstearns / Dockerfile
Last active March 21, 2018 23:59
docker cowsay
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y fortune cowsay && rm -rf /var/lib/apt/lists/*
ENV PATH "$PATH:/usr/games"
CMD [ "/bin/bash", "-c", "/usr/games/fortune | /usr/games/cowsay" ]
@drstearns
drstearns / docker-clean.sh
Last active March 31, 2017 01:18
Script to clean up exited docker containers and dangling docker images
#!/bin/bash
cids=$(docker ps -f "status=exited" -aq)
if [ "$cids" ]; then
docker rm $cids
fi
iids=$(docker images -q --filter "dangling=true")
if [ "$iids" ]; then
docker rmi $iids
fi