gremlin-worker (latest)
Published 2026-06-18 17:04:38 -05:00 by traveler
Installation
docker pull git.netgrimoire.com/traveler/gremlin-worker:latestsha256:cd7c8e7e452ca4b23febcadb62332557b0fb78dbd730f844e55a54884f7cfa73Image layers
| # debian.sh --arch 'amd64' out/ 'trixie' '@1781049600' |
| ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| ENV LANG=C.UTF-8 |
| RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends ca-certificates netbase tzdata ; apt-get dist-clean # buildkit |
| ENV GPG_KEY=7169605F62C751356D054A26A821E680E5FA6305 |
| ENV PYTHON_VERSION=3.12.13 |
| ENV PYTHON_SHA256=c08bc65a81971c1dd5783182826503369466c7e67374d1646519adf05207b684 |
| RUN /bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends dpkg-dev gcc gnupg libbluetooth-dev libbz2-dev libc6-dev libdb-dev libffi-dev libgdbm-dev liblzma-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev make tk-dev uuid-dev wget xz-utils zlib1g-dev ; wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; gpg --batch --verify python.tar.xz.asc python.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME" python.tar.xz.asc; mkdir -p /usr/src/python; tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; rm python.tar.xz; cd /usr/src/python; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --enable-loadable-sqlite-extensions --enable-optimizations --enable-option-checking=fatal --enable-shared $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') --with-ensurepip ; nproc="$(nproc)"; EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; case "$arch" in amd64|arm64) EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; ;; i386) ;; *) EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; ;; esac; make -j "$nproc" "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" "LDFLAGS=${LDFLAGS:-}" ; rm python; make -j "$nproc" "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" python ; make install; cd /; rm -rf /usr/src/python; find /usr/local -depth \( \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \) -exec rm -rf '{}' + ; ldconfig; apt-mark auto '.*' > /dev/null; apt-mark manual $savedAptMark; find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' | sort -u | xargs -rt dpkg-query --search | awk 'sub(":$", "", $1) { print $1 }' | sort -u | xargs -r apt-mark manual ; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; apt-get dist-clean; export PYTHONDONTWRITEBYTECODE=1; python3 --version; pip3 --version # buildkit |
| RUN /bin/sh -c set -eux; for src in idle3 pip3 pydoc3 python3 python3-config; do dst="$(echo "$src" | tr -d 3)"; [ -s "/usr/local/bin/$src" ]; [ ! -e "/usr/local/bin/$dst" ]; ln -svT "$src" "/usr/local/bin/$dst"; done # buildkit |
| CMD ["python3"] |
| RUN /bin/sh -c apt-get update && apt-get install -y git curl openssh-client openssh-server cron nodejs npm iputils-ping dnsutils traceroute net-tools wget netcat-openbsd iproute2 ncurses-term ncurses-bin screen sudo mc xterm locales supervisor && sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen && dpkg-reconfigure --frontend=noninteractive locales && apt-get clean && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN /bin/sh -c curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -o /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd # buildkit |
| ENV LANG=en_US.UTF-8 |
| ENV LC_ALL=en_US.UTF-8 |
| ENV LANGUAGE=en_US.UTF-8 |
| ENV TERM=xterm-256color |
| RUN /bin/sh -c mkdir -p /var/run/sshd # buildkit |
| COPY sshd_config /etc/ssh/sshd_config # buildkit |
| RUN /bin/sh -c groupadd -g 1965 gremlin && useradd -m -u 1965 -g 1965 -s /bin/bash gremlin && useradd -m -u 1964 -s /bin/bash graymutt && echo "graymutt:H@rv3y123" | chpasswd && echo "graymutt ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/gremlin-access && chmod 0440 /etc/sudoers.d/gremlin-access && chown -R gremlin:gremlin /home/gremlin # buildkit |
| RUN /bin/sh -c mkdir -p /home/gremlin/.npm-global && npm install -g @anthropic-ai/claude-code && npm config set update-notifier false && chown -R gremlin:gremlin /home/gremlin/.npm-global # buildkit |
| ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright |
| RUN /bin/sh -c npm install -g playwright && npx playwright install --with-deps chromium && chmod -R a+rX /opt/ms-playwright # buildkit |
| RUN /bin/sh -c pip install --no-cache-dir fastapi uvicorn requests pyyaml anthropic mcp # buildkit |
| USER gremlin |
| RUN /bin/sh -c git config --global user.name "gremlin" && git config --global user.email "gremlin@netgrimoire.com" && git config --global --add safe.directory '*' # buildkit |
| RUN /bin/sh -c mkdir -p /home/gremlin/.claude # buildkit |
| USER root |
| COPY claude-global.md /home/gremlin/.claude/CLAUDE.md # buildkit |
| RUN /bin/sh -c chown gremlin:gremlin /home/gremlin/.claude/CLAUDE.md # buildkit |
| RUN /bin/sh -c printf '#!/bin/bash\nCOLS=$(tput cols 2>/dev/null || echo 200)\nROWS=$(tput lines 2>/dev/null || echo 50)\nstty cols $COLS rows $ROWS 2>/dev/null\nexport TERM=xterm-256color\nexport COLUMNS=$COLS\nexport LINES=$ROWS\nexec claude "$@"\n' > /usr/local/bin/gc && chmod +x /usr/local/bin/gc # buildkit |
| RUN /bin/sh -c echo '' >> /home/gremlin/.bashrc && echo '# Sync PTY dimensions on login' >> /home/gremlin/.bashrc && echo 'if [ -t 1 ]; then eval $(resize 2>/dev/null) || true; fi' >> /home/gremlin/.bashrc && echo '' >> /home/gremlin/.bashrc && echo '# Claude Code TUI wrapper' >> /home/gremlin/.bashrc && echo "alias claude='stty cols \$COLUMNS rows \$LINES && claude'" >> /home/gremlin/.bashrc && echo 'export LANG=en_US.UTF-8' >> /home/gremlin/.bashrc && echo 'export LC_ALL=en_US.UTF-8' >> /home/gremlin/.bashrc && echo 'export PATH=/home/gremlin/.npm-global/bin:$PATH' >> /home/gremlin/.bashrc # buildkit |
| RUN /bin/sh -c echo '' >> /home/graymutt/.bashrc && echo '# Sync PTY dimensions on login' >> /home/graymutt/.bashrc && echo 'if [ -t 1 ]; then eval $(resize 2>/dev/null) || true; fi' >> /home/graymutt/.bashrc && echo '' >> /home/graymutt/.bashrc && echo '# Claude Code TUI wrapper' >> /home/graymutt/.bashrc && echo "alias claude='stty cols \$COLUMNS rows \$LINES && claude'" >> /home/graymutt/.bashrc && echo 'export LANG=en_US.UTF-8' >> /home/graymutt/.bashrc && echo 'export LC_ALL=en_US.UTF-8' >> /home/graymutt/.bashrc && echo 'export PATH=/home/gremlin/.npm-global/bin:$PATH' >> /home/graymutt/.bashrc # buildkit |
| WORKDIR /app |
| COPY app/ . # buildkit |
| COPY crontab /etc/cron.d/gremlin-cron # buildkit |
| RUN /bin/sh -c chmod 0644 /etc/cron.d/gremlin-cron # buildkit |
| COPY supervisord.conf /etc/supervisor/conf.d/gremlin.conf # buildkit |
| COPY entrypoint.sh /entrypoint.sh # buildkit |
| RUN /bin/sh -c chmod +x /entrypoint.sh # buildkit |
| EXPOSE [22/tcp 7681/tcp 8000/tcp 8765/tcp] |
| CMD ["/entrypoint.sh"] |