Cleaning up Lando containers

Submitted by christophe on Tue, 16/10/2018 - 12:34

Depending on how many containers and projects you may have with Lando / Docker, things can go wrong at some time on your local environment, so here is a basic troubleshooting.

First aid

  • Update first Lando and Docker, not a bad idea to start with this.
  • Run lando destroy on unused / stale projects.
  • Keep in mind that when you are working on several projects in the same time, the containers port must be different, so try to use different ports for your services (MaiHog, Solr, ...).

Kill 'em all

Sometimes, it will not be enough and it may be a good idea to restart from scratch.

  • List all containers (even the ones that are not running) docker ps --all
  • Kill all running containers docker kill $(docker ps -q)
  • Delete all stopped containers docker rm $(docker ps -a -q)
  • Delete all images docker rmi $(docker images -q)

Tags

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.