News for hackers. Stuff that matters.
Re:Learn Docker by building a Microservice by n_coats on Wednesday June 01, 2016 @07:55AM (#11813642)
Great post!

For those learning, make sure you look into removing unused images and containers otherwise you might run into some issues a little farther down the road (eventually our builds started failing).

You can run docker rm and docker rmi to remove specific containers and images respectively, but we also found passing the --rm flag with docker run helped a lot as it removes a container after it exits.

Happy learning!

Re:Learn Docker by building a Microservice by roxmon on Wednesday June 01, 2016 @09:45AM (#11814268)
I run into this pretty frequently with Docker on Mac OS X. Passing the `--rm` flag helps, but for cleaning up old/unused containers, I usually set these two commands on a cron:

    # Remove un-tagged or un-named images
    for im in $(docker images | awk '/<none>/ { print $3 }'); do docker rmi $im; done

    # Remove stopped containers
    docker rm $(docker ps -a -q)
Re:Learn Docker by building a Microservice by xahrepap on Wednesday June 01, 2016 @10:45AM (#11814710)
You can also do this:

    docker rmi $(docker images -q -f dangling=true
You might consider doing the same with volumes:

    docker volume rm $(docker volume ls -q -f dangling=true)
But be careful with the volume one. I'd read the documentation around volumes first and see if you're deleting what you want to. :)
Re:Learn Docker by building a Microservice by ThunderGorilla on Wednesday June 01, 2016 @08:28AM (#11813807)
Why did this cause the builds to fail?
Re:Learn Docker by building a Microservice by beardicus on Wednesday June 01, 2016 @09:19AM (#11814091)
Presumably because they ran out of space on the host that was doing the building. It's very easy to never see the gobs of containers and images no longer in use with docker.
Re:Learn Docker by building a Microservice by n_coats on Thursday June 02, 2016 @09:26AM (#11822255)
Exactly what happened.