Docker

Table of Contents

1. Compose

Docker image can be set up by writing docker-compose.yml file.

  • docker compose (or docker-compose)
    • up create and start containers
      • -d, --detach run container in the background

2. Maintenance

2.1. CLI tool

  • docker ps
    • List all containers
  • docker exec
    • -u run as user within the container
    • -i run inside this image

Example of removing all users that starts with a in a Gitea container.

docker exec -u harry -i gitea sh -c '
  gitea admin user list | awk "{print \$2}" | grep "^a" | while read -r u; do
  echo "Delete $u"; gitea admin user delete --username "$u" --purge ;
done'

3. References

Author: Jeemin Kim

Created: 2026-09-10 Thu 21:54