Fix: OpenClaw in Docker โ Connection Refused, Port Mapping, and Network Issues
Running OpenClaw in Docker and getting connection refused? Common issues with port mapping, bind addresses, DNS resolution, and WebSocket upgrades explained with fixes.
Shift-left security means finding misconfigurations in CI/CD โ not in production incident reports. Policy-as-code tools make this automated, consistent, and fast.
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-resource-limits
spec:
validationFailureAction: Enforce
rules:
- name: check-limits
match:
any:
- resources:
kinds:
- Pod
validate:
message: "CPU and memory limits are required"
pattern:
spec:
containers:
- resources:
limits:
memory: "?*"
cpu: "?*"apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sDisallowedTags
metadata:
name: no-latest-tag
spec:
match:
kinds:
- apiGroups: [""]
kinds: ["Pod"]
namespaces: ["production"]
parameters:
tags: ["latest"]
exemptImages:
- "registry.internal/infra/*"# Scan Terraform
checkov -d ./terraform/ --framework terraform --output json
# Scan Kubernetes manifests
checkov -d ./k8s/ --framework kubernetes --compact
# Scan Dockerfiles
checkov -d . --framework dockerfile# GitLab CI example
stages:
- validate
- build
- deploy
security-scan:
stage: validate
image: bridgecrew/checkov:latest
script:
- checkov -d . --framework terraform,kubernetes,dockerfile
--output cli --output junitxml
--output-file-path console,checkov-results.xml
--soft-fail-on LOW
--hard-fail-on HIGH,CRITICAL
artifacts:
reports:
junit: checkov-results.xml
kyverno-test:
stage: validate
image: ghcr.io/kyverno/kyverno-cli:latest
script:
- kyverno apply ./policies/ --resource ./k8s/
allow_failure: falseEvery Kubernetes deployment should enforce:
latest tags โ pin image versionsAudit mode โ see what would fail before enforcingkube-system needs special permissionsImplementing shift-left security? I help teams build secure CI/CD pipelines with policy-as-code. Get in touch.
AI & Cloud Advisor with 18+ years experience. Author of 8 technical books, creator of Ansible Pilot, and instructor at CopyPasteLearn Academy. Speaker at KubeCon EU & Red Hat Summit 2026.
Running OpenClaw in Docker and getting connection refused? Common issues with port mapping, bind addresses, DNS resolution, and WebSocket upgrades explained with fixes.
Getting the allowedorigins error when starting your OpenClaw gateway? Here is exactly how to fix it, with step-by-step configuration for local network, VPS, and reverse proxy setups.
Troubleshoot OpenClaw API key issues across OpenAI, Anthropic, and GitHub Copilot. Covers 401 errors, invalid key formats, rate limits, and model fallback configuration.