Docker Compose : build with docker –rm –force-rm to avoid storing intermediates

I have low memory so I frequently need to delete containers, which sucks.

This github issue is raised by a guy who has the same constraints and is being suggested to use

  • dockerfile: not able to run command
  • Docker stats 100% memory
  • Kubernetes on Fedora 21 Pod Stays Pending
  • Terraform and docker networking
  • Improving Docker security
  • Concourse add file to docker image just once
  • docker --rm --force-rm build

    Can I do the same with docker-compose? How?

    The CLI usage doesn’t seem to accept:

    docker-compose --rm --force-rm build

  • How can a few small Python scripts be run periodically with Docker?
  • Fluentd capture stack traces from Docker
  • An error occurred trying to connect - docker when not using sudo
  • Concurrency error while executing DocumentDB stored procedure on multiple Docker containers
  • strange docker error when stop and starting a container
  • How to copy docker volume to local?
  • One Solution collect form web for “Docker Compose : build with docker –rm –force-rm to avoid storing intermediates”

    As someone has commented, adding these parameters probably isn’t going to accomplish much for you. Compose already defaults to rm=True.

    What you might want to do instead is run something like with a very short “max age”. That way you’ll remove any old container and images soon after they exit.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.