Skip to main content

DevOps Docker & DevContainer

ยท 4 min read
DevOps
DevOps Engineer

Overviewโ€‹

The nnthanh101/terraform:latest Docker image is a secure, lightweight, and production-ready environment tailored for modern CloudOps and DevOps workflows. Built on Chainguard's Wolfi Linux, this image incorporates best practices for multi-cloud, Infrastructure-as-Code (IaC), and Kubernetes ecosystem management.

Designed to meet the demands of multi-cloud environments and enterprise-grade automation, it includes tools for provisioning, configuration management, orchestration, and secrets management. The devops tag extends its functionality with Kubernetes tooling, making it ideal for hybrid-cloud operations.

Tags and Variantsโ€‹

TagDescription
latestCore DevOps tools (e.g., Terraform, Git, AWS CLI, Azure CLI, and linters like TFLint/Tfsec).
devopsIncludes latest + Kubernetes ecosystem tools (kubectl, helm, kustomize, k9s) and Go.

Key Featuresโ€‹

โœ…FeatureDescriptionRelevance
โœ…SecurityBuilt on Chainguard's Wolfi Linux for minimal attack surface and compliance.Chainguard Wolfi
โœ…Multi-Cloud ManagementIntegrated AWS CLI, Azure CLI, and Boto3 SDK for managing multi-cloud environments.AWS CLI Docs
โœ…Kubernetes EcosystemSupports Kubernetes management with kubectl, Helm, and Kustomize (available in devops tag).Kubernetes Docs
โœ…Infrastructure-as-CodeIncludes Terraform and linters like TFLint and Tfsec for compliance and validation.Terraform Docs
โœ…Interactive AutomationPre-configured with Starship and Task for modern shell and task automation.Starship Docs

Pre-installed Toolsโ€‹

Core DevOps Utilitiesโ€‹

โœ…ToolCategoryDescriptionRelevant URL
โœ…terraformInfrastructure-as-CodeAutomate the provisioning of cloud resources.Terraform Docs
โœ…terraform-docsDocumentationAuto-generate documentation for Terraform modules.Terraform Docs
โœ…tflintValidationLinter for validating Terraform configurations.TFLint Docs
โœ…tfsecSecurity AnalysisStatic analysis for Terraform configurations.Tfsec Docs
โœ…atlantisCollaborationTerraform collaboration and CI/CD integration for pull requests.Atlantis Docs
โœ…vaultSecrets ManagementManage secrets and sensitive data securely.Vault Docs

Kubernetes Ecosystem (Available in devops Tag)โ€‹

โœ…ToolCategoryDescriptionRelevant URL
โœ…kubectlKubernetes CLICommand-line tool for Kubernetes cluster management.Kubectl Docs
โœ…helmPackage ManagerManage Kubernetes applications with Helm charts.Helm Docs
โœ…kustomizeConfigurationManage Kubernetes YAML configurations.Kustomize Docs
โœ…k9sKubernetes TUIInteractive terminal UI for managing Kubernetes clusters.K9s Docs

Cloud Managementโ€‹

โœ…ToolCategoryDescriptionRelevant URL
โœ…awscliCloud ManagementCommand-line tools for managing AWS resources.AWS CLI Docs
โœ…azure-cliCloud ManagementCommand-line tools for managing Azure resources.Azure CLI Docs

Usageโ€‹

Pull the Imageโ€‹

docker pull nnthanh101/terraform:latest
docker pull nnthanh101/terraform:devops

Run the Containerโ€‹

Using the latest Tagโ€‹

docker run -it --rm nnthanh101/terraform:latest bash

Using the devops Tagโ€‹

docker run -it --rm nnthanh101/terraform:devops bash

Extend the Imageโ€‹

To add custom utilities or extensions:

FROM nnthanh101/terraform:devops

COPY requirements.txt /workspace/requirements.txt
RUN pip install --no-cache-dir -r /workspace/requirements.txt

Improvements and Recommendationsโ€‹

1. Enhanced Configurationโ€‹

  • Secure Secrets Management: Utilize Vault with automated authentication to AWS or Azure.
  • Extend Aliases:
    alias k='kubectl'
    alias tf='terraform'
    alias tfs='tfsec'

2. Efficient Multi-Cloud Operationsโ€‹

  • Ensure integration with cloud management tools for seamless cross-cloud deployments.

Directory Structureโ€‹

.
โ”œโ”€โ”€ Dockerfile ## Main Dockerfile for building the image
โ”œโ”€โ”€ start.sh ## Startup script to initialize services
โ”œโ”€โ”€ alias.sh ## Aliases for productivity
โ”œโ”€โ”€ .config/
โ”‚ โ””โ”€โ”€ starship.toml ## Starship shell configuration
โ”œโ”€โ”€ Taskfile.yaml ## Task automation script

Contributionโ€‹

We welcome contributions to improve this image! Follow these steps:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request with a detailed description.