skills/linux/linux-docker/SKILL.md
Docker/Compose: Dockerfile, networking, volumes, container lifecycle, registry, security hardening
npx skillsauth add alphaonedev/openclaw-graph linux-dockerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows the AI to handle Docker and Docker Compose operations on Linux, focusing on Dockerfile creation, container management, networking, volumes, lifecycle events, registry interactions, and security hardening to ensure efficient, secure containerized applications.
Use this skill for tasks involving containerization of applications, such as building images from source code, deploying multi-service apps with Compose, managing network configurations for inter-container communication, or securing containers against vulnerabilities in a Linux environment.
--network bridge.-v /host/path:/container/path.--security-opt no-new-privileges to limit capabilities, and scan images with tools like Trivy.To build an image, read a Dockerfile, then execute docker build with appropriate context; for Compose, parse a YAML file and run docker-compose up. Always check for required dependencies like Docker daemon running. For networking, specify networks in Compose YAML under the networks key. Use environment variables for sensitive data, e.g., inject $DOCKER_REGISTRY_URL into container env. For security, always run containers with --read-only flag where possible to prevent writes.
docker build -t myimage:1.0 . (use -f path/Dockerfile for custom file).docker run -d --name mycontainer -p 8080:80 -v /host/data:/app/data myimage:1.0.docker network create mynet then docker run --network mynet myimage.docker volume create myvolume and mount with -v myvolume:/data.docker start mycontainer, docker stop mycontainer, docker rm -f mycontainer.docker login -u user -p $DOCKER_PASSWORD registry.example.com; push with docker push myimage:1.0.docker-compose -f docker-compose.yml up -d; define services in YAML like:
version: '3'
services:
web:
image: nginx
ports:
- "80:80"
$DOCKER_API_KEY.Integrate by ensuring Docker is installed via apt install docker.io on Ubuntu. For registry access, set env vars like export DOCKER_REGISTRY_URL=registry.example.com and export DOCKER_API_KEY=yourkey. When combining with other skills, e.g., in a CI/CD pipeline, use Compose files to orchestrate with tools like Jenkins; reference external configs with ${VAR} in YAML. For security, always pull from trusted registries and use --cap-drop ALL in run commands. If using orchestration tools like Kubernetes, export Compose files with docker-compose config for conversion.
Handle permission errors by prefixing commands with sudo, e.g., sudo docker run ...; check with groups to ensure user is in docker group. For image pull failures, verify registry auth with echo $DOCKER_API_KEY and retry docker pull. Network issues: Use docker network inspect mynet to debug; fix with docker network prune. Dockerfile build errors: Parse logs for messages like "no such file or directory" and correct paths. Compose errors: Validate YAML with docker-compose config before running; common fix for "service not found" is checking indentation. Always use docker ps -a to inspect running/faulty containers and docker logs mycontainer for output.
FROM nginx:alpine; COPY index.html /usr/share/nginx/html;. Then, build it: docker build -t mynginx .. Run securely: docker run -d --name webserver -p 8080:80 --read-only mynginx. Access at localhost:8080.version: '3'
services:
db:
image: postgres
volumes:
- dbdata:/var/lib/postgresql/data
web:
image: mynginx
ports:
- "8080:80"
volumes:
dbdata:
Then, start: docker-compose up -d. Scale web service: docker-compose up -d --scale web=3.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui