NEAR MCP

by nearai
Verified
ARG UBUNTU_VERSION=22.04 ARG PLATFORM=amd64 FROM --platform=${PLATFORM} ubuntu:${UBUNTU_VERSION} as base ARG USER=user ARG USER_UID=1000 ARG USER_GID=$USER_UID ENV NODE_VERSION=22.x ARG BUN_VERSION=v1.2.4 ENV DEBIAN_FRONTEND=noninteractive ## Create unpriv user RUN groupadd --gid $USER_GID $USER \ && useradd --uid $USER_UID --gid $USER_GID -m $USER \ && apt-get update \ && apt-get install -y sudo \ && rm -rf /var/lib/apt/lists/* \ && echo $USER ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USER \ && chmod 0440 /etc/sudoers.d/$USER # Install dependencies RUN apt-get update && \ apt-get -y install --no-install-recommends \ git curl wget jq unzip \ build-essential ca-certificates default-jre \ libudev-dev pkg-config libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install node RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \ apt-get install -y nodejs && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Add gh cli RUN (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \ && sudo mkdir -p -m 755 /etc/apt/keyrings \ && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ && sudo apt update \ && sudo apt install gh -y \ && rm -rf /var/lib/apt/lists/* # Change to non-privileged user USER $USER # Install Bun RUN curl -fsSL https://bun.sh/install | bash -s "bun-${BUN_VERSION}" ENV PATH="/home/$USER/.bun/bin:$PATH" # Install global deps with Bun ARG OPENAPI_GENERATOR_VERSION=2.15.3 ARG CLAUDE_CODE_VERSION=0.2.39 RUN bun install -g \ @openapitools/openapi-generator-cli@${OPENAPI_GENERATOR_VERSION} \ @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION} \ typescript # Install near cli ARG NEAR_CLI_VERSION=v0.17.0 RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/${NEAR_CLI_VERSION}/near-cli-rs-installer.sh | sh # Add Bun to user path ENV PATH="/home/$USER/.bun/bin:$PATH" ## Install oh my zsh # Uses "Spaceship" theme with some customization. Uses some bundled plugins and installs some more from github RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \ -t https://github.com/denysdovhan/spaceship-prompt \ -a 'SPACESHIP_PROMPT_ADD_NEWLINE="false"' \ -a 'SPACESHIP_PROMPT_SEPARATE_LINE="false"' \ -p git \ -p ssh-agent \ -p https://github.com/zsh-users/zsh-autosuggestions \ -p https://github.com/zsh-users/zsh-completions ENV PATH="/home/$USER/.oh-my-zsh/bin:/home/$USER/.local/bin:$PATH"