CloudOps Docker Container
Overviewโ
The nnthanh101/runbooks:latest
image is a secure, lightweight, and production-grade Python environment built on Chainguard's Wolfi Base. This image has been optimized to support multi-cloud environments (AWS, Azure) and cross-platform workflows for CloudOps, FinOps, Analytics, AI, and Data Science projects.
With a focus on modern CloudOps and DevOps practices, this image incorporates security, maintainability, and scalability into its design. It integrates essential extensions like MkDocs, JupyterLab, and Vizro for documentation and analytics workflows.
Key Featuresโ
-
Lightweight and Secure:
- Built on
cgr.dev/chainguard/wolfi-base:latest
, prioritizing security with minimal attack surface. - Non-root
os
user pre-configured to ensure security. - Cross-Platform Support: Supports multiple architectures, including
linux/amd64
andlinux/arm64
.
- Built on
-
Cloud-Native Utilities: Pre-installed tools like
starship
,task
,git-lfs
, and support for pre-configuredPython 3.12
virtual environment support for compatibility with modern workflows. Integrated also withawscli
,azure-cli
, andansible
for provisioning and automation. -
Pre-Bundled Python Extensions: Categorized for analytics, documentation, and cloud operations with AWS CLI, and Azure CLI.
Usageโ
Run a Python Shell and Tasklistโ
Syntax:
docker run -it -p 8888:8888 -v LOCAL_FOLDER:REMOTE_FOLDER registry/image
docker run -it --rm nnthanh101/runbooks:latest bash
export HOME_AWS="$HOME/.aws"
docker run -it --rm -p 8888:8888 \
-v "$(pwd):/workspace:rw" \
-v "${HOST_AWS}:/workspace/.aws:ro" \
nnthanh101/runbooks:latest
Run with Data Mountingโ
export HOST_AWS="$HOME/.aws"
docker run -it -p 8888:8888 \
-v "$(pwd):/workspace:rw" \
-v "${HOST_AWS}:/workspace/.aws:ro" \
--user $(id -u):$(id -g) \
nnthanh101/runbooks:latest
Use for JupyterLabโ
USERNAME=os
docker run -it -p 8888:8888 \
-v $HOME/notebooks:/home/$USERNAME/notebooks \
nnthanh101/runbooks:latest jupyter lab --ip=0.0.0.0 --no-browser
Extend the Imageโ
To add custom Python packages:
FROM nnthanh101/runbooks:latest
COPY requirements.txt /home/os/requirements.txt
RUN pip install --no-cache-dir -r /home/os/requirements.txt
DevContainer Usageโ
-
Project/Folder Structure:
Ensure the host project directory is structured as follows:
โโโ .devcontainer ## VS Code DevContainer configuration
โ โโโ devcontainer.json
โโโ projects ## Your code and Python projects
โโโ credentials ## AWS credentials, config files, etc.
โโโ data ## Raw and processed data files -
Run Command via VS Code:
- Open the project folder in VS Code.
- Press
Ctrl+Shift+P
, select Remote-Containers: Open Folder in Container.... - Choose the folder containing
.devcontainer
.
Technical Notes - Python Extensions:โ
- โ
runbooks:jupyterlab
- โ๏ธ
runbooks:techdocs
- โ๏ธ
runbooks:cloudops
โ | Python Extension | Category | Description | Relevant URL |
---|---|---|---|---|
โ๏ธ | ansible | Infra Automation | Configuration management and orchestration tool. | Ansible Docs |
โ๏ธ | awscli | Cloud Management | Command-line interface for AWS services. | AWS CLI Docs |
โ๏ธ | azure-cli | Cloud Management | Command-line tools for managing Azure resources. | Azure CLI Docs |
โ๏ธ | boto3 | Cloud Management | AWS SDK for Python to automate and manage AWS services programmatically. | Boto3 Docs |
MkDocs and Extensions | ||||
โ๏ธ | mkdocs | Documentation Tools | A static site generator for project documentation. | MkDocs Docs |
โ๏ธ | mkdocs-material | Documentation Tools | A modern, responsive theme for MkDocs. | Material Theme |
โ๏ธ | mkdocstrings | Documentation Tools | Plugin for documenting Python code using docstrings. | MkDocstrings |
โ๏ธ | mkdocstrings[python] | Documentation Tools | Enhanced Python support for mkdocstrings . | MkDocstrings Python |
โ๏ธ | mkdocs-drawio-exporter | Documentation Tools | Export draw.io diagrams to integrate with MkDocs. | DrawIO Exporter |
โ๏ธ | pymdown-extensions | Documentation Tools | Markdown extensions for advanced formatting. | Pymdown Extensions |
โ๏ธ | pygments | Documentation Tools | Syntax highlighter for MkDocs and other tools. | Pygments Docs |
JupyterLab Ecosystem | ||||
โ | gunicorn | Web Application Hosting | Lightweight WSGI server for Python web applications. | Gunicorn Docs |
โ | ipykernel | Interactive Computing | Core dependency for running Jupyter Notebook kernels. | IPyKernel Docs |
โ | ipywidgets | Interactive Computing | Interactive widgets for Jupyter. | IPyWidgets Docs |
โ | jupyterlab | Interactive Computing | Web-based interface for interactive Python computing. | JupyterLab Docs |
โ | jupyterlab-git | Interactive Computing | Git integration for JupyterLab. | JupyterLab Git |
โฌ | jupyter-resource-usage | Interactive Computing | Monitor system resource usage during JupyterLab sessions. | Resource Usage |
โฌ | jupyter_scheduler | Interactive Computing | Schedule and manage Jupyter Notebook execution tasks. | Jupyter Scheduler |
โ๏ธ | pandas | Data Science | Library for data manipulation and analysis. | Pandas Docs |
โ๏ธ | plotly | Data Visualization | Interactive and publication-quality data visualization. | Plotly Docs |
โ๏ธ | vizro | Data Visualization | Lightweight dashboards for Python data visualization. | Vizro Docs |