Files
openclaw/docker/Dockerfile

61 lines
2.0 KiB
Docker

# OpenClaw Gateway - Custom ARM64 Build
# Platform: linux/arm64
# Configs are volume-mounted at runtime, not baked into image
FROM --platform=linux/arm64 ghcr.io/openclaw/openclaw:latest
USER root
# Install additional system packages
RUN apt-get update && apt-get install -y \
jq \
curl \
htop \
tree \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Install Google Cloud SDK (for gcloud CLI if needed)
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
| gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
&& apt-get update && apt-get install -y google-cloud-cli \
&& rm -rf /var/lib/apt/lists/*
# Install gog (Google Workspace CLI) for ARM64
# Using direct binary install since brew may not be available
RUN GOG_VERSION=$(curl -s https://api.github.com/repos/steipete/gog/releases/latest | jq -r .tag_name) \
&& curl -L "https://github.com/steipete/gog/releases/download/${GOG_VERSION}/gog_Linux_arm64.tar.gz" \
| tar -xz -C /usr/local/bin/ \
&& chmod +x /usr/local/bin/gog
# Copy custom tools into the image
COPY docker/tools/* /usr/local/bin/
COPY docker/bin/* /usr/local/bin/
RUN chmod +x /usr/local/bin/*
# Create directories for volume-mounted configs
# These will be mounted at runtime with your secrets and configs
RUN mkdir -p /data/config /data/secrets /data/gog \
&& chown -R node:node /data
# Set environment for config paths
ENV OPENCLAW_CONFIG_DIR=/data/config
ENV GOG_CONFIG_DIR=/data/gog
ENV GOOGLE_APPLICATION_CREDENTIALS=/data/secrets/google-credentials.json
# Link gog config to persistent location
RUN ln -sf /data/gog /home/node/.config/gog
# SSH keys will be stored in persistent volume
# Create directory and symlink for SSH
RUN mkdir -p /home/node/.openclaw/ssh \
&& ln -sf /home/node/.openclaw/ssh /home/node/.ssh
# Switch back to node user
USER node
# Default entrypoint from base image