- Cloud Native Applications
- Application Security
- Application Security
- Web Application Security
- Application Security Posture Management (ASPM)
- Microsegmentation
- Python Security
- SaaS Security
- Node.JS Security
- PHP Security
- AI in Cyber Security
- Cybersecurity for Financial Services
- The Principle of Least Privilege (PoLP)
- Identity and Access Management
- Cybersecurity in Banking
- Threat Detection and Response
- Cyber Kill Chain
- Threat Hunting
- Zero Trust Security
- Zero Trust Architecture
- Fileless Attacks
- DSPM
- Container Scanning
- Kubernetes
- Kubernetes
- Kubernetes Alternatives
- Kubernetes Namespace
- Kubernetes Architecture
- Kubernetes Cluster
- Kubernetes Nodes
- Kubernetes Pods
- Kubernetes Jobs
- Kubernetes Workloads
- Kubernetes Monitoring
- Kubernetes Security
- Kubernetes RBAC
- Secret Scanning
- Kubernetes Security Posture Management (KSPM)
- Kubernetes on AWS
- Kubernetes on VMware
- Kubernetes Vulnerability Scanning
- Managing Containers in Kubernetes
- K3s
- eBPF in Kubernetes
- Kubernetes Dashboard
- Kubernetes Operators
- Kubernetes Services
- Kubernetes Devops
- Kubernetes Networking
- Kubernetes ConfigMap
- Kubernetes Management
- Kubernetes Helm
- Kubernetes as a Service
- Kubernetes Serverless
- Kubernetes Tutorials
- Cloud Attacks
- Cloud Attacks
- Malware Attacks
- Zero Day Attack
- Top 10 Cyber Security Threats
- Arbitrary Code Execution
- Cryptojacking
- AI Attacks
- Prompt Injection
- Backdoor Attacks
- Reverse Shell Attack
- Remote Code Execution
- Defense Evasion
- Honeypots in Cybersecurity
- Malware Analysis
- AI Malware
- Lateral Movement
- Advanced Malware Protection
- CNAPP
- AI Security
- Container Platforms
- Containerized Architecture
- Containerized Architecture
- Docker Secrets
- Container Runtime Interface
- Container Images
- Image Scanning
- Container Compliance
- Docker Security Best Practices
- Container Security
- Container Security Best Practices
- Container Security Tools
- ECS Security
- Network Segmentation
- Istio security
- runC
- Service Mesh
- Image Repository
- Container Escape
- Container Runtime
- Docker Container
- OSS Container Image Scanning Tools
- What Is a Container?
- Docker Images
- Containerization 101
- VM vs. Container
- Containerization vs. Virtualization
- Containerized Applications
- Microservices and Containerization
- Registry Scanning
- Docker CVEs
- Docker Monitoring
- Securing Containers with Docker Scanning
- Docker CIS Benchmark
- Seccomp
- Docker Alpine
- Docker API
- Docker Tools
- 100 Best Docker Tutorials
- Docker Alternatives
- Docker Swarm
- Docker Containers vs. Virtual Machines (VMs)
- Docker Architecture
- Docker Networking
- Docker Registries
- Docker Orchestration
- OpenShift vs Docker
- Container Cloud Computing
- Container DevOps
- Docker in Production
- Container Monitoring
- Container Advantages
- Docker Hub
- Serverless Architecture
- Supply Chain Security
- Supply Chain Compliance
- SolarWinds Attack
- Supply Chain Security
- Secure Software Development Lifecycle
- Software Supply Chain Attacks
- Dependency Confusion Attack
- SLSA
- SSDF
- Software Composition Analysis
- Security Misconfigurations
- Repojacking
- Privilege Escalation
- CI/CD Security
- SAST Security
- GitLab Security
- GitHub Secret Scanning
- OWASP Dependency-Check
- Software Bill of Materials
- SBOM Tools
- NPM Vulnerabilities
- Log4j Vulnerability
- Text4Shell
- Secrets Management
- Jenkins Security
- Yarn vs. NPM
- Source Code Leaks
- Container Image Signing
- Open Source Licenses
- Vulnerability Management
- Vulnerability Management Tools
- Vulnerability Scanning Process
- Vulnerability Management
- Vulnerability Scanning
- Vulnerability Prioritization
- Open Source Vulnerability Scanning
- Vulnerability Remediation
- Vulnerability Scanner
- Risk-Based Vulnerability Management
- Vulnerability Exploitability eXchange (VEX)
- Malware Detection
- Fileless Malware
- Attack Vectors
- Malicious Code
- Risk Posture
- Alert Fatigue in Cybersecurity
- Cyber Security Posture
- MITRE ATT&CK
- MITRE ATT&CK Framework
- LLM Security
- Code Scanning
- Attack Surface
- Attack Surface Management
- What Are Indicators of Compromise (IoC)?
- Secure Code
- Configuration Drift
- Trivy
- DevSecOps
- DevSecOps
- DevSecOps Pipeline
- DevSecOps Best Practices
- DevSecOps vs SecDevOps
- Threat Modeling
- Mean Time to Repair (MTTR)
- eBPF Linux
- Cloud DevOps
- DevOps Tools
- GitOps vs DevOps
- Code Security
- Secure Code Review
- DevOps Security
- Infrastructure as Code (IaC) Security
- Infrastructure as Code DevOps
- Executive Order 14028 (U.S. Cybersecurity Executive Order)
- Open Source Security
- Shift-Left Security
- Shift Right Testing and Security
- What Is SecOps (Security Operations)?
- SecDevOps
- DevSecOps Tools
- Linux Security
- Rocky Linux
- Azure DevOps
- Cloud Security
- Cloud Security
- Cloud Security Challenges
- Cloud Security Tools
- Code to Cloud
- Cloud Protection
- Cloud Security Frameworks
- Cloud Security Standards
- Cloud Security Controls
- Cloud Security Posture Management (CSPM)
- AI Workloads
- Cloud Digital Forensics
- Cloud Computing Security Architecture
- What Is Enterprise Cloud Security?
- Virtualized Security
- CSPM Tools
- Vulnerabilities in Cloud Computing
- Top 7 Risks of Cloud Computing
- Cloud Security Assessment
- Cloud Visibility
- Cloud Governance
- Cloud Security Strategy
- Cloud Security Policy
- DFIR
- Cloud Workloads
- Public Cloud Security
- Private Cloud vs. Public Cloud
- Runtime Security
- Azure Cloud Security
- Azure Security Best Practices
- Azure Security vs. AWS Security
- AWS GovCloud: Basics & How It Compares to Azure & GCP
- S3 Security
- Cloud Misconfiguration
- Terraform Security
- Hybrid Cloud Security
- Multi-Cloud Strategy
- Agentless vs. Agent-Based Security & Monitoring
- Cloud Infrastructure Security
- Gartner CSPM
- Cloud Security Scanner
- AWS CIS Benchmark
- Cloud Configuration Management
- Cloud Workload Protection (CWP)
- Cloud Workload Protection Platforms (CWPP)
- Cloud Workload Security
- Cloud Vulnerabilities and Tools that Can Help
- Google Cloud Security
- Shared Responsibility Model
- AWS Shared Responsibility Model
- AWS Cloud Security
- Multi Cloud Security
- Cloud Compliance
- Kubernetes in Production
- Cloud Detection And Response
Container Images: Architecture and Best Practices
Learn how container images are structured, the difference between containers and images, parent and base images, and the role of the Docker manifest.
What is Container Image?
A container image is a static file with executable code that can create a container on a computing system. A container image is immutable—meaning it cannot be changed, and can be deployed consistently in any environment. It is a core component of a containerized architecture.
Container images include everything a container needs to run—the container engine such as Docker or CoreOS, system libraries, utilities, configuration settings, and specific workloads that should run on the container. The image shares the operating system kernel of the host, so it does not need to include a full operating system.
A container image is composed of layers, added on to a parent image (also known as a base image). Layers make it possible to reuse components and configurations across images. Constructing layers in an optimal manner can help reduce container size and improve performance.
In this article, you will learn:
Docker Image Architecture
Docker is the world’s most popular container engine, so we will focus our discussion of container image architecture on Docker.
A Docker image is a collection of files, including binaries, source code and other dependencies, needed to deploy a container environment. In Docker, there are two ways to create an images:
- Dockerfile—Docker provides a simple, human-readable configuration file that specifies what a Docker image should contain.
- Create an image from an existing container—you can run a container from an existing image, modify the container environment, and save the result as a new image.
What is the Difference Between Docker Containers and Images?
A Docker container image describes a container environment. A Docker container is an instance of that environment, running on Docker Engine. You can run multiple containers from the same image, and all of them will contain the same software and configuration, as specified in the image.
Docker Images and Layers
When you define a Docker image, you can use one or more layers, each of which includes system libraries, dependencies and files needed for the container environment. Image layers can be reused for different projects.
To save time, most Docker images start from a parent image. For example, here is the Dockerfile of the MySQL image on Docker Hub, which can be used to create containers running the MySQL database. On top of this parent image, you can add layers that include additional software or specific configurations.
When a container runs, Docker adds a readable/writable top layer over the static image layers. This top layer is used by the container to modify files during runtime, and can also be used to customize the container. This way, multiple containers created from the same image can have different data.
There are two ways to view layers added to the base image:
- /var/lib/docker/aufs/diff directory on the container
- Using the Docker CLI history command
Parent and Base Images
There is a subtle technical different between parent and base images:
- A base image is an empty container image, which allows advanced users to create an image from scratch.
- A parent image is a pre-configured image that provides some basic functionality, such as a stripped-down Linux system, a database such as MySQL or PostgreSQL, or a content management system such as WordPress.
However, in the container community, the terms “base image” and “parent image” are often used interchangeably.
There is a large number of ready-made parent images available on Docker Hub, and on many other public container repositories. You can also use your own images as a parent for new images.
Docker Manifest
Each Docker image comes with a file called a manifest. This is a JSON file that describes the image and provides metadata such as tags, a digital signature to verify the origin of the image, and documentation.
Docker Image Security Best Practices
Container images play a crucial role in container security. Any container created from an image inherits all its characteristics—including security vulnerabilities, misconfigurations, or even malware.
Here are a few best practices that can help you ensure you only use secure, verified images in your container projects:
- Prefer minimal base images—many Docker images use a fully installed operating system distribution as their underlying image. If you don’t need general system libraries, avoid using base images that install an entire operating system, or other components that are not essential for your project, to limit the attack surface.
- Least privileged user—Dockerfiles must always specify a USER, otherwise they will default to running the container as root on the host machine. You should also avoid running applications on the container with root privileges. Running as root can have severe security consequences, because attackers compromising the container can gain control over the entire host.
- Sign and verify images—you must make sure the image you are pulling to create your container is really the image you selected from a trusted publisher, or created yourself. By using only signed images, you can mitigate tampering with the image over the wire (a man in the middle attack), or attackers pushing compromised images to a trusted repository.
- Fix open source vulnerabilities—whenever you use a parent image in production, you need to be able to trust all the components it deploys. Automatically scan images as part of your build process, to ensure they do not contain vulnerabilities, security misconfigurations, or backdoors. Keep in mind new vulnerabilities may be introduced over time, even in images that were originally verified as secure.
Related content: read our guide to Docker security best practices ›
Container Image Q&A
What is Docker Hub?
Docker Hub is the world’s largest container image registry. You can use it to access publicly available Docker images, or store your own images. There are many other tools you can use to manage a container image repository, including:
- Harbor
- Amazon Elastic Container Registry (ECR)
- Azure Container Registry (ACR)
- Google Container Registry
- JFrog Artifactory
- Red Hat Quay
What is a Docker Image Security Scan?
Docker image security scanning lets you find security vulnerabilities in Docker image files. Image scanning works by analyzing packages and dependencies defined in a container image, and checking each of them for known security vulnerabilities. Some container image registries provide built-in image scanning tools.
- Containerized Architecture: Components and Design Principles
- Docker Secrets
- Container Runtime Interface (CRI): Past, Present, and Future
- What is Image Scanning?
- The Container Compliance Almanac: NIST, PCI, GDPR and CIS
- Docker Security Best Practices
- What Is Container Security?
- Top 10 Container Security Best Practices
- A Guide to Container Security Tools for 2024
- ECS Security
- Network Segmentation
- Istio security
- runC
- Service Mesh: Architecture, Concepts, and Top 4 Frameworks
- Image Repository: Which Container Image Repository Is Right for You?
- What Is Container Escape?
- What Is a Container Runtime?
- Show more
Aqua Cloud Native Application Protection Platform (CNAPP)
Go cloud native with the experts!