pplmx / LearningDocker

To store Dockerfile

Home Page:https://caoyu.info/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerfile Best Practices

  • Avoid unnecessary privileges
    • Rootless containers
    • Don’t bind to a specific UID
    • Make executables owned by root and not writable
  • Reduce attack surface
    • Multistage builds
    • Distroless, from scratch
    • Use trusted base images
    • Update your images frequently
    • Exposed ports
  • Prevent confidential data leaks
    • Credentials and confidentiality
    • ADD, COPY
    • Build context and dockerignore
  • Others
    • Layer sanity
    • Metadata labels
    • Linting
    • Locally scan images during development
  • Beyond image building
    • Docker port socket and TCP protection
    • Sign images and verify signatures
    • Tag mutability
    • Run as non-root
    • Include health / liveness checks
    • Drop capabilities

Referenced from

About

To store Dockerfile

https://caoyu.info/

License:MIT License


Languages

Language:Dockerfile 45.6%Language:Groovy 26.7%Language:Python 13.5%Language:Makefile 8.3%Language:PHP 5.9%