None

2 snippets across 2 stacks - Docker, Python

Also written as none none

DKDocker

Dangling Images & Orphan Volumes

DK · Common Mistakes
Syntax
# Check dangling images:
docker images -f dangling=true
# Check orphan volumes:
docker volume ls -f dangling=true
Example
# Frequent rebuilds leave untagged images:
docker images -f dangling=true
# REPOSITORY  TAG     SIZE
# <none>      <none>  450MB
# <none>      <none>  450MB

# Clean them:
docker image prune
docker volume prune

Note Every time you rebuild with the same tag, the old image loses its tag and becomes <none>:<none>. These pile up fast. Volumes from removed containers also linger. Schedule regular prune commands or add them to your CI cleanup steps.

PYPython

None (Null Value)

PY · Variables & Types
Syntax
variable = None
Example
result = None
if result is None:
    print("No result yet")

# Common pattern: optional return
def find_user(user_id: int) -> str | None:
    return None
Output
No result yet

Note Always compare to None with 'is' or 'is not', never == or !=. None is a singleton object.

Frequently asked questions

How does Docker handle None?
This task is covered in 2 stacks on this page: Docker, Python. The "Dangling Images & Orphan Volumes" snippet in Docker uses `# Check dangling images:`.
Which command does the Docker example use?
The "Dangling Images & Orphan Volumes" snippet uses `# Check dangling images:`, from the Common Mistakes section of the Docker cheat sheet.
Which stacks cover "None" on this page?
Docker, Python. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "Dangling Images & Orphan Volumes": Every time you rebuild with the same tag, the old image loses its tag and becomes <none>:<none>. These pile up fast. Volumes from removed containers also linger. Schedule regular prune commands or add them to your CI cleanup steps.