Golden Codes - armanexplorer planet

Practical code snippets for Django, Python, Bash, Git and All!

View on GitHub

docker runtime constraints on resources

Docs

docker --rm

In summary, when you pass the --rm flag to the docker run command while running a continuous command like python manage.py runserver, the container will be removed when the command is stopped or exits. The --rm flag removes the container and its associated file system, but not any volumes that were created or any data that was stored in those volumes.

If you want to remove the volumes associated with the container when it is removed, you can use the -v flag along with the --rm flag

--mount

Docs

cache type

RUN --mount=type=cache,id=custom-pip-cache,target=/root/.cache/pip pip install -r req.txt