<commit_before>Containers
**********

.. highlight:: bash

Using this ``Dockerfile``::

  FROM tomcat

Build::

  docker build -t mytomcat .

Run::

  docker run -d -p 8080:8080 mytomcat

List::

  docker ps -aq

Remove all exited containers::

  docker rm $(docker ps -a -f status=exited -q)

Kill all::

  docker kill `docker ps -q`<commit_msg>docker containers<commit_after>Containers
**********

.. highlight:: bash

Using this ``Dockerfile``::

  FROM tomcat

Build::

  docker build -t mytomcat .

Run::

  docker run -d -p 8080:8080 mytomcat

List::

  docker ps -a
  docker ps -aq

Run bash::

  ❯ docker ps -a
  CONTAINER ID    IMAGE             COMMAND
  e33f95652391    apple_apple       "/srv/apple/docker"
  ❯ docker exec -it e33f95652391 bash
  root@e33f95652391:/srv/apple# python3 manage.py shell

Remove all exited containers::

  # bash
  docker rm $(docker ps -a -f status=exited -q)
  # fish
  docker rm (docker ps -a -f status=exited -q)

Kill all::

  docker kill `docker ps -q`
{'fraction_non_alphanumeric': 0.124, 'fraction_numerical': 0.047, 'mean_word_length': 2.87984496124031, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6425219', 'n_tokens_mistral': 431, 'n_tokens_neox': 354, 'n_words': 122}