Skip to content

Instantly share code, notes, and snippets.

@craftpip
Created February 18, 2026 15:32
Show Gist options
  • Select an option

  • Save craftpip/d1c5fe1235b353a0970278893b7abe2b to your computer and use it in GitHub Desktop.

Select an option

Save craftpip/d1c5fe1235b353a0970278893b7abe2b to your computer and use it in GitHub Desktop.
openclaw inside docker inside wsl
services:
openclaw:
build:
context: .
dockerfile: Dockerfile
image: openclaw-node23:latest
group_add:
- 1001
tty: true
# user: root
stdin_open: true
restart: unless-stopped
command: ["/bin/sh", "-lc", "exec openclaw gateway run --bind lan"]
ports:
- "18789:18789"
volumes:
- /mnt/c:/mnt/c
- /mnt/d:/mnt/d
- /mnt/e:/mnt/e
- /mnt/f:/mnt/f
- .:/home/node/.openclaw
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker:ro
FROM node:23-bookworm
WORKDIR /tmp/openclaw-build
RUN apt-get update && \
apt-get install -y ca-certificates curl gnupg && \
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
bookworm stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y docker-ce-cli docker-compose-plugin && \
rm -rf /var/lib/apt/lists/*
RUN npm install --global openclaw
RUN mkdir -p /home/node/.openclaw/workspace
RUN useradd --create-home --shell /bin/bash linuxbrew
RUN mkdir -p /home/linuxbrew/.linuxbrew \
&& chown -R linuxbrew:linuxbrew /home/linuxbrew
USER linuxbrew
ENV NONINTERACTIVE=1
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
USER root
RUN chown -R node:node /home/linuxbrew/.linuxbrew /home/node/.openclaw
# RUN apt install -y docker.io docker-compose-plugin
USER node
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
WORKDIR /home/node/.openclaw/workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment