Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Bentoml BentoML Common Debian Setup

From Leeroopedia
Revision as of 12:06, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Bentoml_BentoML_Common_Debian_Setup.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains DevContainer, Shell Scripting, Environment Setup
Last Updated 2026-02-13 15:00 GMT

Overview

A Bash setup script that provisions a Debian-based VS Code devcontainer with common developer tools, user configuration, shell customization (Bash and Zsh with Oh My Zsh), and locale settings.

Description

This script is part of the Microsoft VS Code dev containers library and is used by the BentoML project to configure a reproducible development environment. It performs the following major operations:

  1. Package installation: Installs a comprehensive set of developer tools and system libraries including curl, wget, git, jq, htop, vim-tiny, openssh-client, gnupg2, and many others via apt-get.
  2. User management: Creates or updates a non-root user with configurable UID/GID, adds sudo access, and handles automatic user detection from a list of common devcontainer usernames (vscode, node, codespace).
  3. Locale configuration: Ensures en_US.UTF-8 locale is available and generated.
  4. Shell customization: Injects RC snippets into .bashrc and .zshrc for PATH management, first-run notices, and Git editor configuration. Installs custom Codespaces-themed prompts for both Bash and Zsh.
  5. Oh My Zsh installation: Optionally clones and configures Oh My Zsh with a custom Codespaces theme.
  6. Shim scripts: Creates /usr/local/bin/code and /usr/local/bin/systemctl shim scripts for compatibility.
  7. Marker file: Writes a state marker file at /usr/local/etc/vscode-dev-containers/common to enable idempotent re-runs.

The script is designed to be idempotent: it checks marker files to skip previously completed steps on subsequent runs.

Usage

This script is invoked during devcontainer image build (typically from a Dockerfile). It should be run as root. It is not called directly during normal BentoML development or runtime; it is part of the one-time container provisioning process.

Code Reference

Source Location

Signature

# Invocation syntax:
./common-debian.sh [install_zsh] [username] [user_uid] [user_gid] [upgrade_packages] [install_oh_my_zsh] [add_non_free_packages]

Import

# Sourced/executed from a Dockerfile:
COPY library-scripts/*.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/common-debian.sh "true" "vscode" "automatic" "automatic" "true" "true" "false"

I/O Contract

Inputs

Name Type Required Description
install_zsh string ("true"/"false") No (default: "true") Whether to install Zsh shell
username string No (default: "automatic") Username to create or configure; "automatic" detects existing user
user_uid string No (default: "automatic") Desired UID for the user; "automatic" uses system defaults
user_gid string No (default: "automatic") Desired GID for the user; "automatic" uses system defaults
upgrade_packages string ("true"/"false") No (default: "true") Whether to upgrade all installed packages
install_oh_my_zsh string ("true"/"false") No (default: "true") Whether to install Oh My Zsh
add_non_free_packages string ("true"/"false") No (default: "false") Whether to enable Debian non-free repos for POSIX manpages

Outputs

Name Type Description
Marker file File /usr/local/etc/vscode-dev-containers/common tracking installation state
Configured user System user Non-root user with sudo, shell configuration, and RC files
Installed packages APT packages Developer tools and system libraries installed via apt-get
Shell configuration Files Customized .bashrc, .zshrc, and Oh My Zsh theme files

Usage Examples

# Default invocation - install everything with automatic user detection
sudo bash /tmp/library-scripts/common-debian.sh

# Custom invocation - specific user, no zsh, no package upgrade
sudo bash /tmp/library-scripts/common-debian.sh "false" "devuser" "1000" "1000" "false" "false" "false"

# Typical Dockerfile usage
RUN bash /tmp/library-scripts/common-debian.sh "true" "vscode" "automatic" "automatic" "true" "true" "false"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment