gitlab-agent-operator/agent (sha256:420d1423b28132052f238253c9e0f950e0857b5d35de8e59927fbc9cef7825f2)
Published 2026-11-18 21:13:58 +01:00 by daniel
Installation
docker pull forge.n0de.biz/daniel/gitlab-agent-operator/agent@sha256:420d1423b28132052f238253c9e0f950e0857b5d35de8e59927fbc9cef7825f2sha256:420d1423b28132052f238253c9e0f950e0857b5d35de8e59927fbc9cef7825f2Image layers
| ADD alpine-minirootfs-3.24.4-x86_64.tar.gz / # buildkit |
| CMD ["/bin/sh"] |
| ENV NODE_VERSION=26.13.1 |
| RUN /bin/sh -c addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/sh -D node && apk add --no-cache libatomic libstdc++ && apk add --no-cache --virtual .build-deps gnupg curl && ARCH= OPENSSL_ARCH='linux*' && alpineArch="$(apk --print-arch)" && case "${alpineArch##*-}" in x86_64) ARCH='x64' OPENSSL_ARCH=linux-x86_64;; aarch64) OPENSSL_ARCH=linux-aarch64;; *) echo "unsupported architecture"; exit 1 ;; esac && export GNUPGHOME="$(mktemp -d)" && set -ex && for key in 5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 CC68F5A3106FF448322E48ED27F5E38D5B0A215F 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C 108F52B48DB57BB0CC439B2997B01419BD92F80A 655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD A363A499291CBBC940DD62E41F10027AF002F8B0 ; do { gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || { gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; done && if [ "$ARCH" = "x64" ]; then curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc && gpgconf --kill all && rm -rf "$GNUPGHOME" && grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt && ln -s /usr/local/bin/node /usr/local/bin/nodejs; else echo "Building from source" && apk add --no-cache --virtual .build-deps-full binutils-gold g++ gcc libgcc linux-headers make python3 py-setuptools rust cargo && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc && gpgconf --kill all && rm -rf "$GNUPGHOME" && grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - && tar -xf "node-v$NODE_VERSION.tar.xz" && cd "node-v$NODE_VERSION" && ./configure && make -j$(getconf _NPROCESSORS_ONLN) V= && make install && apk del .build-deps-full && cd .. && rm -Rf "node-v$NODE_VERSION" && rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt; fi && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; && apk del .build-deps && node --version && npm --version && rm -rf /tmp/* # buildkit |
| COPY docker-entrypoint.sh /usr/local/bin/ # buildkit |
| ENTRYPOINT ["docker-entrypoint.sh"] |
| CMD ["node"] |
| RUN /bin/sh -c apk add --no-cache git curl bash jq coreutils shadow sudo xz grep python3 libgcc libstdc++ # buildkit |
| ENV npm_config_libc=musl |
| ARG CLAUDE_CODE_VERSION=2.1.327 |
| RUN |1 CLAUDE_CODE_VERSION=2.1.327 /bin/sh -c npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" # buildkit |
| ARG CLAUDE_AGENT_SDK_VERSION=0.3.327 |
| RUN |2 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 /bin/sh -c npm install -g "@anthropic-ai/claude-agent-sdk@${CLAUDE_AGENT_SDK_VERSION}" # buildkit |
| ARG PI_VERSION=1.5.2 |
| RUN |3 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 /bin/sh -c npm install -g --ignore-scripts "@earendil-works/pi-coding-agent@${PI_VERSION}" # buildkit |
| ARG RTK_VERSION=1.2.0 |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c curl -fsSL "https://github.com/rtk-ai/rtk/releases/download/v${RTK_VERSION}/rtk-$(uname -m)-unknown-linux-musl.tar.gz" | tar -xz -C /usr/local/bin rtk && chmod 555 /usr/local/bin/rtk # buildkit |
| COPY agent.sh /agent.sh # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c chmod +x /agent.sh # buildkit |
| COPY runner.mjs /runner.mjs # buildkit |
| COPY push-policy.mjs /push-policy.mjs # buildkit |
| COPY mcp-policy.mjs /mcp-policy.mjs # buildkit |
| COPY live-input.mjs /live-input.mjs # buildkit |
| COPY result-policy.mjs /result-policy.mjs # buildkit |
| COPY compact-policy.mjs /compact-policy.mjs # buildkit |
| COPY append-prompt.mjs /append-prompt.mjs # buildkit |
| COPY otel-env.mjs /otel-env.mjs # buildkit |
| COPY progress-queue.mjs /progress-queue.mjs # buildkit |
| COPY pi-runner.mjs /pi-runner.mjs # buildkit |
| COPY pi-events.mjs /pi-events.mjs # buildkit |
| COPY pi-models.mjs /pi-models.mjs # buildkit |
| COPY loop-guard.mjs /loop-guard.mjs # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c chmod 555 /runner.mjs /push-policy.mjs /mcp-policy.mjs /live-input.mjs /result-policy.mjs /compact-policy.mjs /append-prompt.mjs /otel-env.mjs /progress-queue.mjs /pi-runner.mjs /pi-events.mjs /pi-models.mjs /loop-guard.mjs # buildkit |
| COPY git-push-guard /usr/local/bin/git # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c chmod 555 /usr/local/bin/git # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c mkdir -p /etc/git-hooks # buildkit |
| COPY git-hooks/pre-push /etc/git-hooks/pre-push # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c chmod 555 /etc/git-hooks/pre-push && chmod 555 /etc/git-hooks # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c git config --system core.hooksPath /etc/git-hooks # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c git config --system --add safe.directory '*' # buildkit |
| RUN |4 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 /bin/sh -c adduser -D -u 65532 agent # buildkit |
| ARG NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist |
| RUN |5 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist /bin/sh -c groupadd nixbld -U agent && curl -fL "$NIX_STATIC_URL" > /bin/nix && chmod +x /bin/nix # buildkit |
| RUN |5 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist /bin/sh -c mkdir -p /etc/nix && printf 'experimental-features = nix-command flakes\nsandbox = false\nfilter-syscalls = false\n' > /etc/nix/nix.conf # buildkit |
| ARG NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 |
| RUN |6 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 /bin/sh -c mkdir -p /tmp/nixpkgs-src && curl -fL "https://github.com/NixOS/nixpkgs/archive/${NIXPKGS_REV}.tar.gz" | tar -xz -C /tmp/nixpkgs-src && mv /tmp/nixpkgs-src/nixpkgs-* /opt/nixpkgs && rm -rf /tmp/nixpkgs-src && printf '{"version":2,"flakes":[{"from":{"type":"indirect","id":"nixpkgs"},"to":{"type":"path","path":"/opt/nixpkgs"}}]}\n' > /etc/nix/registry.json # buildkit |
| ENV NIX_PATH=nixpkgs=/opt/nixpkgs |
| ENV HOME=/home/agent |
| USER agent |
| ENV CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 |
| RUN |6 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 /bin/sh -c for p in superpowers feature-dev code-review commit-commands code-simplifier security-guidance ; do claude plugin install "${p}@claude-plugins-official" || true; done # buildkit |
| RUN |6 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 /bin/sh -c mkdir -p /home/agent/.claude && rtk init -g # buildkit |
| COPY --chown=agent:agent rtk-hook.sh /usr/local/bin/rtk-hook # buildkit |
| COPY --chown=agent:agent deny-policy.mjs /deny-policy.mjs # buildkit |
| RUN |6 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 /bin/sh -c chmod 555 /usr/local/bin/rtk-hook # buildkit |
| COPY --chown=agent:agent claude-settings.json /home/agent/.claude/settings.json # buildkit |
| ENV RTK_SUPPRESS_HOOK_WARNING=true |
| RUN |6 CLAUDE_CODE_VERSION=2.1.327 CLAUDE_AGENT_SDK_VERSION=0.3.327 PI_VERSION=1.5.2 RTK_VERSION=1.2.0 NIX_STATIC_URL=https://hydra.nixos.org/build/337988365/download-by-type/file/binary-dist NIXPKGS_REV=5d2b81a7a3be3e2f832879028e4d60abbf58e9a0 /bin/sh -c mkdir -p /home/agent/.claude/instructions # buildkit |
| COPY --chown=agent:agent instructions/mr-agent.md /home/agent/.claude/instructions/mr-agent.md # buildkit |
| COPY --chown=agent:agent instructions/issue-agent.md /home/agent/.claude/instructions/issue-agent.md # buildkit |
| COPY --chown=agent:agent instructions/review-agent.md /home/agent/.claude/instructions/review-agent.md # buildkit |
| COPY --chown=agent:agent instructions/plan-review-agent.md /home/agent/.claude/instructions/plan-review-agent.md # buildkit |
| COPY --chown=agent:agent instructions/intent-review-agent.md /home/agent/.claude/instructions/intent-review-agent.md # buildkit |
| COPY --chown=agent:agent instructions/orchestrator-agent.md /home/agent/.claude/instructions/orchestrator-agent.md # buildkit |
| COPY --chown=agent:agent instructions/_common.md /home/agent/.claude/instructions/_common.md # buildkit |
| ENTRYPOINT ["/bin/bash" "/agent.sh"] |