diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3b331eb..46741ce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,8 +13,12 @@ permissions: jobs: test: - name: "Test" + name: "Test (${{ matrix.image }})" runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: [fx, php, nodejs, golang, python] steps: - name: Checkout uses: actions/checkout@v6 @@ -25,20 +29,24 @@ jobs: - name: Build image for testing uses: docker/build-push-action@v7 with: - context: ./fx - file: ./fx/Dockerfile + context: ./${{ matrix.image }} + file: ./${{ matrix.image }}/Dockerfile push: false - tags: dockette/coder:fx-test + tags: dockette/coder:${{ matrix.image }}-test platforms: linux/amd64 load: true - name: Smoke test image - run: make test DOCKER_TAG=fx-test + run: make test DOCKER_VARIANT=${{ matrix.image }} DOCKER_TAG=${{ matrix.image }}-test build: - name: "Build" + name: "Build (${{ matrix.image }})" needs: test runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: [fx, php, nodejs, golang, python] steps: - name: Checkout uses: actions/checkout@v6 @@ -58,10 +66,10 @@ jobs: - name: Build and push uses: docker/build-push-action@v7 with: - context: ./fx - file: ./fx/Dockerfile + context: ./${{ matrix.image }} + file: ./${{ matrix.image }}/Dockerfile push: ${{ github.ref == 'refs/heads/master' }} - tags: dockette/coder:fx + tags: dockette/coder:${{ matrix.image }} platforms: linux/amd64 cache-from: type=gha cache-to: type=gha diff --git a/Makefile b/Makefile index 95fcffe..7af2106 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,71 @@ DOCKER_IMAGE=dockette/coder -DOCKER_TAG?=fx +DOCKER_VARIANT?=fx +DOCKER_TAG?=$(DOCKER_VARIANT) DOCKER_PLATFORMS?=linux/amd64 +# Shared tools present in all images +TOOLS_COMMON=agent-browser gh claude opencode codex copilot + .PHONY: build build: - docker buildx build --platform ${DOCKER_PLATFORMS} -t ${DOCKER_IMAGE}:${DOCKER_TAG} fx/ + docker buildx build --platform ${DOCKER_PLATFORMS} -t ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_VARIANT}/ + +.PHONY: build-all +build-all: + $(MAKE) build DOCKER_VARIANT=fx + $(MAKE) build DOCKER_VARIANT=php + $(MAKE) build DOCKER_VARIANT=nodejs + $(MAKE) build DOCKER_VARIANT=golang + $(MAKE) build DOCKER_VARIANT=python .PHONY: test test: + $(MAKE) test-${DOCKER_VARIANT} + +.PHONY: test-all +test-all: + $(MAKE) test-fx + $(MAKE) test-php + $(MAKE) test-nodejs + $(MAKE) test-golang + $(MAKE) test-python + +.PHONY: test-fx +test-fx: docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} npm --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node -e "console.log(process.arch)" + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} go version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} python3 --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} pip3 --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} php --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} composer --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} deno --version docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} bun --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} agent-browser --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} gh --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} claude --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} opencode --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} codex --version - docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} copilot --version + $(foreach tool,$(TOOLS_COMMON),docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} $(tool) --version;) + +.PHONY: test-php +test-php: + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} php --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} composer --version + $(foreach tool,$(TOOLS_COMMON),docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} $(tool) --version;) + +.PHONY: test-nodejs +test-nodejs: + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} npm --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node -e "console.log(process.arch)" + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} deno --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} bun --version + $(foreach tool,$(TOOLS_COMMON),docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} $(tool) --version;) + +.PHONY: test-golang +test-golang: + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} go version + $(foreach tool,$(TOOLS_COMMON),docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} $(tool) --version;) + +.PHONY: test-python +test-python: + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} python3 --version + docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} pip3 --version + $(foreach tool,$(TOOLS_COMMON),docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} $(tool) --version;) diff --git a/fx/Dockerfile b/fx/Dockerfile index 02d7719..2582b02 100644 --- a/fx/Dockerfile +++ b/fx/Dockerfile @@ -3,32 +3,59 @@ FROM codercom/enterprise-base:ubuntu ENV DENO_INSTALL=/usr/local ENV BUN_INSTALL=/usr/local ENV NODE_VERSION=22 +ENV GO_VERSION=1.24.2 +ENV GOROOT=/usr/local/go +ENV GOPATH=/home/coder/go +ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH USER root -RUN apt update && apt dist-upgrade -y && \ - mkdir -p -m 755 /etc/apt/keyrings && \ - apt install -y curl git wget htop jq ripgrep && \ - # NODE ###################################################################### +RUN \ + # REPOS #################################################################### + # Add all package repos first, then do a single apt-get update + apt-get update && \ + apt-get install -y --no-install-recommends curl wget software-properties-common gpg && \ + # Node repo curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \ - apt install -y nodejs && \ - # PHP ####################################################################### + # PHP repo add-apt-repository -y ppa:ondrej/php && \ - apt update -y && \ - apt install -y --no-install-recommends \ + # GitHub CLI repo + wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ + mkdir -p -m 755 /etc/apt/keyrings && \ + install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ + rm -f /tmp/githubcli-archive-keyring.gpg && \ + # SINGLE UPDATE + INSTALL ################################################## + apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends \ + git jq ripgrep \ + # Node + nodejs \ + # PHP php8.5-cli php8.5-common php8.5-curl php8.5-gd php8.5-imap php8.5-intl \ php8.5-mailparse php8.5-mbstring php8.5-mysql php8.5-pgsql php8.5-phpdbg \ php8.5-readline php8.5-redis php8.5-soap php8.5-sqlite3 php8.5-xml \ - php8.5-zip php8.5-bcmath php8.5-apcu php8.5-imagick && \ + php8.5-zip php8.5-bcmath php8.5-apcu php8.5-imagick \ + # Python + python3 python3-pip python3-venv \ + # GitHub CLI + gh \ + # Chrome libs (agent-browser) + libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ + libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ + libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ + libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ + libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ echo 'variables_order = "EGPCS"' > /etc/php/8.5/cli/conf.d/99-coder.ini && \ + # GOLANG #################################################################### + ARCH=$(dpkg --print-architecture) && \ + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz" -o /tmp/go.tar.gz && \ + tar -C /usr/local -xzf /tmp/go.tar.gz && \ + rm /tmp/go.tar.gz && \ + mkdir -p /home/coder/go && \ # COMPOSER ################################################################## curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \ - # GITHUB CLI ################################################################ - wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ - install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ - apt update -y && \ - apt install -y --no-install-recommends gh && \ # DENO ###################################################################### curl -fsSL https://deno.land/install.sh | sh && \ # BUN ####################################################################### @@ -48,30 +75,30 @@ RUN apt update && apt dist-upgrade -y && \ ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \ # NPM: CODEX, COPILOT ####################################################### npm install -g @openai/codex @github/copilot && \ - # CHROME LIBS (AGENT-BROWSER) ############################################### - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ - libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ - libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ - libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ - libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ + # AGENT-BROWSER ############################################################## npm install -g agent-browser && \ runuser -u coder -- agent-browser install && \ # PROFILE (DENO, BUN PATH) ################################################## echo '' >> /etc/profile && \ + echo '# Go' >> /etc/profile && \ + echo 'export GOROOT=/usr/local/go' >> /etc/profile && \ + echo 'export GOPATH="$HOME/go"' >> /etc/profile && \ + echo 'export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"' >> /etc/profile && \ + echo '' >> /etc/profile && \ echo '# Deno, Bun' >> /etc/profile && \ echo 'export DENO_INSTALL="${DENO_INSTALL:-/usr/local}"' >> /etc/profile && \ echo 'export BUN_INSTALL="${BUN_INSTALL:-/usr/local}"' >> /etc/profile && \ echo '[ -d "$DENO_INSTALL/bin" ] && export PATH="$DENO_INSTALL/bin:$PATH"' >> /etc/profile && \ echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile && \ # OWNERSHIP (coder can upgrade tools) ###################################### - chown -R coder:coder /home/coder/.local /home/coder/.opencode 2>/dev/null || true && \ + chown -R coder:coder /home/coder/.local /home/coder/.opencode /home/coder/go 2>/dev/null || true && \ # CLEANUP ################################################################### - apt clean -y && \ - apt autoclean -y && \ - apt remove -y wget && \ - apt autoremove -y && \ - rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get remove -y wget software-properties-common && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ + /root/.npm /root/.cache /root/.local /root/.opencode /root/.bun WORKDIR /home/coder diff --git a/golang/Dockerfile b/golang/Dockerfile new file mode 100644 index 0000000..761805c --- /dev/null +++ b/golang/Dockerfile @@ -0,0 +1,76 @@ +FROM codercom/enterprise-base:ubuntu + +ENV NODE_VERSION=22 +ENV GO_VERSION=1.24.2 +ENV GOROOT=/usr/local/go +ENV GOPATH=/home/coder/go +ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH + +USER root + +RUN \ + # REPOS #################################################################### + apt-get update && \ + apt-get install -y --no-install-recommends curl wget gpg && \ + # Node repo (needed for npm tools) + curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \ + # GitHub CLI repo + wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ + mkdir -p -m 755 /etc/apt/keyrings && \ + install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ + rm -f /tmp/githubcli-archive-keyring.gpg && \ + # SINGLE UPDATE + INSTALL ################################################## + apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends \ + git jq ripgrep nodejs gh \ + # Chrome libs (agent-browser) + libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ + libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ + libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ + libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ + libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ + # GOLANG #################################################################### + ARCH=$(dpkg --print-architecture) && \ + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz" -o /tmp/go.tar.gz && \ + tar -C /usr/local -xzf /tmp/go.tar.gz && \ + rm /tmp/go.tar.gz && \ + mkdir -p /home/coder/go && \ + # CLAUDE #################################################################### + (curl -fsSL https://claude.ai/install.sh | bash || true) && \ + mkdir -p /home/coder/.local/bin && \ + if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /home/coder/.local/bin/claude; fi && \ + if [ -f /root/bin/claude ]; then cp /root/bin/claude /home/coder/.local/bin/claude; fi && \ + chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \ + ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \ + # OPENCODE ################################################################## + (curl -fsSL https://opencode.ai/install | bash || true) && \ + mkdir -p /home/coder/.opencode/bin && \ + if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \ + chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \ + ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \ + # NPM: CODEX, COPILOT ####################################################### + npm install -g @openai/codex @github/copilot && \ + # AGENT-BROWSER ############################################################## + npm install -g agent-browser && \ + runuser -u coder -- agent-browser install && \ + # PROFILE ################################################################## + echo '' >> /etc/profile && \ + echo '# Go' >> /etc/profile && \ + echo 'export GOROOT=/usr/local/go' >> /etc/profile && \ + echo 'export GOPATH="$HOME/go"' >> /etc/profile && \ + echo 'export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"' >> /etc/profile && \ + # OWNERSHIP ################################################################ + chown -R coder:coder /home/coder/.local /home/coder/.opencode /home/coder/go 2>/dev/null || true && \ + # CLEANUP ################################################################### + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get remove -y wget && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ + /root/.npm /root/.cache /root/.local /root/.opencode + +WORKDIR /home/coder + +USER coder diff --git a/nodejs/Dockerfile b/nodejs/Dockerfile new file mode 100644 index 0000000..f1fefb2 --- /dev/null +++ b/nodejs/Dockerfile @@ -0,0 +1,73 @@ +FROM codercom/enterprise-base:ubuntu + +ENV DENO_INSTALL=/usr/local +ENV BUN_INSTALL=/usr/local +ENV NODE_VERSION=22 + +USER root + +RUN \ + # REPOS #################################################################### + apt-get update && \ + apt-get install -y --no-install-recommends curl wget gpg && \ + # Node repo + curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \ + # GitHub CLI repo + wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ + mkdir -p -m 755 /etc/apt/keyrings && \ + install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ + rm -f /tmp/githubcli-archive-keyring.gpg && \ + # SINGLE UPDATE + INSTALL ################################################## + apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends \ + git jq ripgrep nodejs gh \ + # Chrome libs (agent-browser) + libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ + libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ + libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ + libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ + libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ + # DENO ###################################################################### + curl -fsSL https://deno.land/install.sh | sh && \ + # BUN ####################################################################### + curl -fsSL https://bun.sh/install | bash && \ + # CLAUDE #################################################################### + (curl -fsSL https://claude.ai/install.sh | bash || true) && \ + mkdir -p /home/coder/.local/bin && \ + if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /home/coder/.local/bin/claude; fi && \ + if [ -f /root/bin/claude ]; then cp /root/bin/claude /home/coder/.local/bin/claude; fi && \ + chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \ + ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \ + # OPENCODE ################################################################## + (curl -fsSL https://opencode.ai/install | bash || true) && \ + mkdir -p /home/coder/.opencode/bin && \ + if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \ + chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \ + ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \ + # NPM: CODEX, COPILOT ####################################################### + npm install -g @openai/codex @github/copilot && \ + # AGENT-BROWSER ############################################################## + npm install -g agent-browser && \ + runuser -u coder -- agent-browser install && \ + # PROFILE ################################################################## + echo '' >> /etc/profile && \ + echo '# Deno, Bun' >> /etc/profile && \ + echo 'export DENO_INSTALL="${DENO_INSTALL:-/usr/local}"' >> /etc/profile && \ + echo 'export BUN_INSTALL="${BUN_INSTALL:-/usr/local}"' >> /etc/profile && \ + echo '[ -d "$DENO_INSTALL/bin" ] && export PATH="$DENO_INSTALL/bin:$PATH"' >> /etc/profile && \ + echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile && \ + # OWNERSHIP ################################################################ + chown -R coder:coder /home/coder/.local /home/coder/.opencode 2>/dev/null || true && \ + # CLEANUP ################################################################### + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get remove -y wget && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ + /root/.npm /root/.cache /root/.local /root/.opencode /root/.bun + +WORKDIR /home/coder + +USER coder diff --git a/php/Dockerfile b/php/Dockerfile new file mode 100644 index 0000000..940e8ae --- /dev/null +++ b/php/Dockerfile @@ -0,0 +1,72 @@ +FROM codercom/enterprise-base:ubuntu + +ENV NODE_VERSION=22 + +USER root + +RUN \ + # REPOS #################################################################### + apt-get update && \ + apt-get install -y --no-install-recommends curl wget software-properties-common gpg && \ + # Node repo (needed for npm tools) + curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \ + # PHP repo + add-apt-repository -y ppa:ondrej/php && \ + # GitHub CLI repo + wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ + mkdir -p -m 755 /etc/apt/keyrings && \ + install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ + rm -f /tmp/githubcli-archive-keyring.gpg && \ + # SINGLE UPDATE + INSTALL ################################################## + apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends \ + git jq ripgrep nodejs \ + # PHP + php8.5-cli php8.5-common php8.5-curl php8.5-gd php8.5-imap php8.5-intl \ + php8.5-mailparse php8.5-mbstring php8.5-mysql php8.5-pgsql php8.5-phpdbg \ + php8.5-readline php8.5-redis php8.5-soap php8.5-sqlite3 php8.5-xml \ + php8.5-zip php8.5-bcmath php8.5-apcu php8.5-imagick \ + # GitHub CLI + gh \ + # Chrome libs (agent-browser) + libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ + libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ + libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ + libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ + libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ + echo 'variables_order = "EGPCS"' > /etc/php/8.5/cli/conf.d/99-coder.ini && \ + # COMPOSER ################################################################## + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \ + # CLAUDE #################################################################### + (curl -fsSL https://claude.ai/install.sh | bash || true) && \ + mkdir -p /home/coder/.local/bin && \ + if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /home/coder/.local/bin/claude; fi && \ + if [ -f /root/bin/claude ]; then cp /root/bin/claude /home/coder/.local/bin/claude; fi && \ + chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \ + ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \ + # OPENCODE ################################################################## + (curl -fsSL https://opencode.ai/install | bash || true) && \ + mkdir -p /home/coder/.opencode/bin && \ + if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \ + chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \ + ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \ + # NPM: CODEX, COPILOT ####################################################### + npm install -g @openai/codex @github/copilot && \ + # AGENT-BROWSER ############################################################## + npm install -g agent-browser && \ + runuser -u coder -- agent-browser install && \ + # OWNERSHIP ################################################################ + chown -R coder:coder /home/coder/.local /home/coder/.opencode 2>/dev/null || true && \ + # CLEANUP ################################################################### + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get remove -y wget software-properties-common && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ + /root/.npm /root/.cache /root/.local /root/.opencode + +WORKDIR /home/coder + +USER coder diff --git a/python/Dockerfile b/python/Dockerfile new file mode 100644 index 0000000..21755bb --- /dev/null +++ b/python/Dockerfile @@ -0,0 +1,62 @@ +FROM codercom/enterprise-base:ubuntu + +ENV NODE_VERSION=22 + +USER root + +RUN \ + # REPOS #################################################################### + apt-get update && \ + apt-get install -y --no-install-recommends curl wget gpg && \ + # Node repo (needed for npm tools) + curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \ + # GitHub CLI repo + wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ + mkdir -p -m 755 /etc/apt/keyrings && \ + install -D -m 644 /tmp/githubcli-archive-keyring.gpg /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" > /etc/apt/sources.list.d/github-cli.list && \ + rm -f /tmp/githubcli-archive-keyring.gpg && \ + # SINGLE UPDATE + INSTALL ################################################## + apt-get update && \ + apt-get dist-upgrade -y && \ + apt-get install -y --no-install-recommends \ + git jq ripgrep nodejs gh \ + # Python + python3 python3-pip python3-venv \ + # Chrome libs (agent-browser) + libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \ + libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \ + libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ + libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \ + libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \ + # CLAUDE #################################################################### + (curl -fsSL https://claude.ai/install.sh | bash || true) && \ + mkdir -p /home/coder/.local/bin && \ + if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /home/coder/.local/bin/claude; fi && \ + if [ -f /root/bin/claude ]; then cp /root/bin/claude /home/coder/.local/bin/claude; fi && \ + chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \ + ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \ + # OPENCODE ################################################################## + (curl -fsSL https://opencode.ai/install | bash || true) && \ + mkdir -p /home/coder/.opencode/bin && \ + if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \ + chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \ + ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \ + # NPM: CODEX, COPILOT ####################################################### + npm install -g @openai/codex @github/copilot && \ + # AGENT-BROWSER ############################################################## + npm install -g agent-browser && \ + runuser -u coder -- agent-browser install && \ + # OWNERSHIP ################################################################ + chown -R coder:coder /home/coder/.local /home/coder/.opencode 2>/dev/null || true && \ + # CLEANUP ################################################################### + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get remove -y wget && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ + /root/.npm /root/.cache /root/.local /root/.opencode + +WORKDIR /home/coder + +USER coder