BU

build-dash-ha-container

A skill to create and manage the Docker container required for building sonic-dash-ha.

Install

mkdir -p .claude/skills/build-dash-ha-container && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10180" && unzip -o skill.zip -d .claude/skills/build-dash-ha-container && rm skill.zip

Installs to .claude/skills/build-dash-ha-container

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Create the sonic-dash-ha Docker build container from scratch and verify the repo compiles. Use when: setting up a new build container, bootstrapping the dash-ha dev environment, "create the build container", "set up sonic-dash-ha container", installing build dependencies, building libswsscommon.
296 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Create a fresh Docker build container
  • Install system build dependencies
  • Install Rust toolchain
  • Build libswsscommon with patches
  • Persist build environment variables
  • Verify repository compilation

How it works

It sets up a bind-mounted Docker container, installs necessary toolchains and dependencies, patches the swss-common library, and configures the environment for compilation.

Inputs & outputs

You give it
Path to local sonic-dash-ha checkout
You get back
Functional Docker build container

When to use build-dash-ha-container

  • Initialize a new build environment
  • Set up the sonic-dash-ha container
  • Verify container configuration
  • Onboard new developers with a reproducible build setup

About this skill

Build the sonic-dash-ha Container

When to Use

  • Setting up a fresh local build environment for sonic-dash-ha
  • The sonic-dash-ha build container does not exist yet (check with docker ps -a)
  • Onboarding a new developer who needs a reproducible build container

This skill creates the build container. To compile/test in an existing container, use the build-test-dash-ha skill instead.

Prerequisites

  • Docker installed and running (docker --version)
  • Network access to pull ubuntu:22.04, clone sonic-swss-common, and fetch crates

Default Configuration

ParameterDefault Value
Container namesonic-dash-ha
Base imageubuntu:22.04
Host repo path<path-to-sonic-dash-ha>
Container repo path/sonic-dash-ha (bind-mounted from host)
swss-common path/opt/sonic-swss-common

The host repo path is a placeholder — substitute the actual path to the user's local sonic-dash-ha checkout. If the user provides a different container name or base image, use those instead.

Procedure

Step 1: Create the container

Bind-mount the host repo so builds operate on the working tree directly.

docker run -d --name sonic-dash-ha --hostname sonic-dash-ha \
  -v <path-to-sonic-dash-ha>:/sonic-dash-ha \
  -w /sonic-dash-ha ubuntu:22.04 sleep infinity
docker ps --filter name=sonic-dash-ha --format '{{.Names}}\t{{.Status}}'

If a container with the same name already exists, stop and tell the user. Do not delete it without confirmation.

Step 2: Install system build dependencies

This includes the Rust/protobuf toolchain, the full sonic-swss-common build dependency chain, and libclang-dev/clang (required by bindgen in the swss-common crate — easy to miss).

docker exec -e DEBIAN_FRONTEND=noninteractive sonic-dash-ha bash -c "apt-get update && apt-get install -y --no-install-recommends \
  build-essential make protobuf-compiler libprotobuf-dev curl git ca-certificates \
  pkg-config libssl-dev autoconf automake libtool libhiredis-dev \
  libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev swig4.0 \
  libboost-serialization-dev libboost-dev uuid-dev libzmq3-dev libgtest-dev libgmock-dev \
  cmake nlohmann-json3-dev python3 python3-dev python-is-python3 cython3 \
  libclang-dev clang"

Step 3: Install the Rust toolchain

docker exec sonic-dash-ha bash -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable"
docker exec sonic-dash-ha /root/.cargo/bin/rustc --version

Step 4: Build libswsscommon (with the redisapi.h patch)

Clone sonic-swss-common, apply the README patch that redirects the hard-coded Lua script path, configure with YANG modules disabled (avoids the sonic_yang/libyang dependency, which isn't needed for the FFI bridge), then build.

docker exec sonic-dash-ha bash -c "cd /opt && git clone --depth 1 https://github.com/sonic-net/sonic-swss-common && \
  sed -i 's#return readTextFile(\"/usr/share/swss/\" + path);#return readTextFile(\"/opt/sonic-swss-common/common/\" + path);#' /opt/sonic-swss-common/common/redisapi.h"

docker exec sonic-dash-ha bash -c "cd /opt/sonic-swss-common && ./autogen.sh && \
  ./configure --enable-yangmodules=no && make -j \$(nproc)"

Verify the shared library was produced:

docker exec sonic-dash-ha bash -c "ls -l /opt/sonic-swss-common/common/.libs/libswsscommon.so"

Step 5: Persist build environment variables

Write the env vars to a profile script and source it from .bashrc so every docker exec bash -l session has them.

docker exec sonic-dash-ha bash -c 'printf "export PATH=\"/root/.cargo/bin:\$PATH\"\nexport SWSS_COMMON_REPO=\"/opt/sonic-swss-common\"\nexport LD_LIBRARY_PATH=\"/opt/sonic-swss-common/common/.libs\"\n" > /etc/profile.d/dash-ha.sh; \
  grep -q dash-ha.sh /root/.bashrc || echo "source /etc/profile.d/dash-ha.sh" >> /root/.bashrc'

Step 6: Verify the repo builds

docker exec sonic-dash-ha bash -lc "cd /sonic-dash-ha && cargo build --workspace 2>&1 | tail -n 30"

A successful run ends with Finished \dev` profile ... target(s)and exit code 0, compiling all crates includinghamgrd, swbusd, and swss-common-bridge`.

Gotchas

  • libclang: The swss-common crate uses bindgen, which needs libclang-dev. Without it the build fails with "Unable to find libclang". Not mentioned in the README.
  • YANG modules: The default sonic-swss-common build enables YANG modules and requires the sonic_yang Python module + libyang. Use --enable-yangmodules=no to skip that dependency chain — the FFI bridge does not need it.
  • Python required by configure: sonic-swss-common's configure aborts without a Python interpreter; install python3/python3-dev before configuring.
  • redisapi.h patch: The hard-coded /usr/share/swss/ path must be patched to the clone location, or runtime Lua script loading breaks. See the README for details.
  • Bind mount vs. docker cp: This skill bind-mounts the host repo so edits are immediately visible. The build-test-dash-ha skill instead copies a fresh tree in; pick whichever workflow the user expects.
  • Base image: ubuntu:22.04 (jammy) provides compatible protoc, boost, and libclang-14 versions. Newer bases may pull incompatible toolchain versions.

When not to use it

  • When the build container already exists
  • When you only need to compile or test in an existing container

Prerequisites

Docker installed and runningNetwork access

Limitations

  • Requires manual confirmation to stop existing containers
  • Depends on specific base image versions for compatibility

How it compares

It creates a reproducible, bind-mounted environment from scratch, whereas other methods might use existing containers or different copy-based workflows.

Compared to similar skills

build-dash-ha-container side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
build-dash-ha-container (this skill)02moReviewIntermediate
docker-expert116moReviewIntermediate
deployment-engineer44moNo flagsAdvanced
devops26moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

docker-expert

davila7

Docker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and production deployment patterns. Use PROACTIVELY for Dockerfile optimization, container issues, image size problems, security hardening, networking, and orchestration challenges.

1135

deployment-engineer

sickn33

Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.

418

devops

mrgoonie

Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

216

ecs

itsmostafa

AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.

215

add-install-docker-ci-e2e

RLinf

Adds install command in install script, Docker build stage in Dockerfile, and CI jobs for docker build, install script, and embodied e2e test when introducing a new model or environment in RLinf. Use when adding a new embodied model (e.g. dexbotic), new env (e.g. maniskill_libero), or new model+env combination that should be installable, dockerized, and tested in CI.

16

devcontainer-management

netalertx

Guide for identifying, managing, and running commands within the NetAlertX development container. Use this when asked to run commands, testing, setup scripts, or troubleshoot container issues.

13

Search skills

Search the agent skills registry