CloakBrowser Docker & Self-Hosted Deployment

GitHub

Stealth Chromium that passes every bot detection test. Drop-in Playwright replacement with source-level fingerprint patches. 30/30 tests passed.

1. Pull Image (DOCKERHUB) docker pull CloakHQ/CloakBrowser:latest
2. Docker Run (1-Click Launch) docker run -d --name cloakbrowser --restart always cloakhq/cloakbrowser:latest
3. Podman Run podman run -d --name cloakbrowser --restart always cloakhq/cloakbrowser:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/cloakhq/cloakbrowser:latest
5. ORAS Pull (OCI Artifact) oras pull cloakhq/cloakbrowser:latest
examples/integrations/aws_lambda/Dockerfile
# CloakBrowser on AWS Lambda โ€” derived from the official CloakHQ image.
#
# `FROM cloakhq/cloakbrowser:<tag>` is an official distribution channel under
# the CloakBrowser Binary License โ€” pulling it isn't redistribution. We just
# layer Lambda glue on top: the Lambda Runtime Interface Client (awslambdaric),
# the Lambda Runtime Interface Emulator (for local `docker run` testing), the
# dual-mode entrypoint, and the handler module.
#
# This directory is self-contained โ€” copy/clone it anywhere and build from
# inside it. No files outside this directory are referenced.
#
# โ”€โ”€โ”€ Lambda invocation (default CMD) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
#   # From inside this directory:
#   docker buildx build --platform linux/arm64 -t cloakbrowser-lambda:arm64 --load .
#
#   # Or from a parent dir, pointing at this directory as the build context:
#   docker buildx build --platform linux/arm64 \
#     -f path/to/aws_lambda/Dockerfile -t cloakbrowser-lambda:arm64 --load \
#     path/to/aws_lambda
#
#   docker run --rm -p 9000:8080 cloakbrowser-lambda:arm64
#   curl -XPOST http://localhost:9000/2015-03-31/functions/function/invocations \
#     -d '{"url":"https://example.com"}'
#
# โ”€โ”€โ”€ Same as the canonical CloakHQ image (CMD overridden) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
#   docker run --rm -it cloakbrowser-lambda:arm64 python                          # REPL
#   docker run --rm cloakbrowser-lambda:arm64 python examples/basic.py            # examples
#   docker run --rm -p 9222:9222 cloakbrowser-lambda:arm64 cloakserve --port=9222 # CDP server
#   docker run --rm cloakbrowser-lambda:arm64 cloaktest                           # stealth tests
#   docker run --rm -it cloakbrowser-lambda:arm64 node                            # JS wrapper
#   docker run --rm -it cloakbrowser-lambda:arm64 bash                            # shell
#
# Pin a specific tag (e.g. cloakhq/cloakbrowser:0.3.25) for reproducible builds;
# `latest` floats with CloakHQ's release cadence.

FROM cloakhq/cloakbrowser:latest

# โ”€โ”€โ”€ Lambda Runtime Interface Client โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
RUN pip install --no-cache-dir awslambdaric

# โ”€โ”€โ”€ Lambda Runtime Interface Emulator (local `docker run` testing) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Bundled into the image so users can hit the standard local-invoke endpoint
# without mounting the RIE separately. TARGETARCH is provided by buildx.
ARG TARGETARCH
ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-${TARGETARCH} \
    /usr/local/bin/aws-lambda-rie
RUN chmod +x /usr/local/bin/aws-lambda-rie

# โ”€โ”€โ”€ Lambda glue โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# Dual-mode entrypoint replaces the canonical bin/docker-entrypoint.sh: same
# Xvfb startup, plus routing for `module.func` CMDs through awslambdaric.
COPY lambda-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Handler sits at /app (already on Python's import path in the canonical image,
# WORKDIR=/app), imports cloakbrowser as a normal library.
COPY lambda_handler.py /app/lambda_handler.py

# โ”€โ”€โ”€ Lambda non-root readability fix โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# The canonical image bakes the Chromium binary at /root/.cloakbrowser/ (root's
# HOME at build time). Lambda runs the container as a non-root user that can't
# read /root by default (mode 750). Make the whole binary tree world-readable
# and traversable. Also restore the .welcome_shown marker the canonical image
# rm's (Lambda's read-only runtime FS can't recreate it, so the welcome would
# print to CloudWatch on every cold start otherwise).
RUN touch /root/.cloakbrowser/.welcome_shown \
    && chmod -R o+rX /root /root/.cloakbrowser

# โ”€โ”€โ”€ Lambda runtime env โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# HOME=/tmp gives Chromium a writable scratch dir (Lambda only allows writes
# under /tmp). CLOAKBROWSER_CACHE_DIR points at the baked binary location since
# HOME=/tmp would otherwise make get_cache_dir() resolve to /tmp/.cloakbrowser
# (empty). Auto-update is disabled because the runtime FS is read-only.
ENV HOME=/tmp \
    CLOAKBROWSER_CACHE_DIR=/root/.cloakbrowser \
    CLOAKBROWSER_AUTO_UPDATE=false

ENTRYPOINT ["/entrypoint.sh"]
CMD ["lambda_handler.handler"]