Skip to content

Commit 5247f5d

Browse files
committed
Fx: big upgrade
1 parent c2eb2f3 commit 5247f5d

4 files changed

Lines changed: 117 additions & 87 deletions

File tree

.github/workflows/docker.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,39 @@ permissions:
1313
contents: read
1414

1515
jobs:
16+
test:
17+
name: "Test"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Build image for testing
27+
uses: docker/build-push-action@v6
28+
with:
29+
context: ./fx
30+
file: ./fx/Dockerfile
31+
push: false
32+
tags: dockette/coder:fx-test
33+
platforms: linux/amd64
34+
cache-from: type=gha
35+
cache-to: type=gha,mode=max
36+
load: true
37+
38+
- name: Smoke test image
39+
run: make test DOCKER_TAG=fx-test
40+
1641
build:
1742
name: "Build"
43+
needs: test
1844
uses: dockette/.github/.github/workflows/docker.yml@master
1945
secrets: inherit
2046
with:
2147
image: "dockette/coder"
2248
tag: "fx"
2349
context: "fx"
50+
platforms: "linux/amd64"
51+
push: ${{ github.ref == 'refs/heads/master' }}

Makefile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
DOCKER_IMAGE=dockette/coder
22
DOCKER_TAG?=fx
3-
DOCKER_PLATFORMS?=linux/amd64,linux/arm64
3+
DOCKER_PLATFORMS?=linux/amd64
44

5+
.PHONY: build
56
build:
67
docker buildx build --platform ${DOCKER_PLATFORMS} -t ${DOCKER_IMAGE}:${DOCKER_TAG} fx/
78

9+
.PHONY: test
810
test:
9-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} node --version
10-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} php --version
11-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} composer --version
12-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} deno --version
13-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} bun --version
14-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} gh --version
15-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} claude --version
16-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} cursor-agent --version
17-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} opencode --version
18-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} codex --version
19-
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} copilot --version
11+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node --version
12+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} npm --version
13+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} node -e "console.log(process.arch)"
14+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} php --version
15+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} composer --version
16+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} deno --version
17+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} bun --version
18+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} agent-browser --version
19+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} gh --version
20+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} claude --version
21+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} opencode --version
22+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} codex --version
23+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} copilot --version

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<h1 align=center>Dockette / Coder</h1>
22

33
<p align=center>
4-
Docker base images for <a href="https://coder.com">Coder</a> workspaces.
5-
Extends the official Coder image with AI tooling.
4+
Docker images for <a href="https://coder.com">Coder</a> workspaces. Built on Coder’s enterprise base
5+
and extended with PHP, Node tooling, and a few AI CLIs we use day to day.
66
</p>
77

88
-----
99

10+
## Motivation
11+
12+
`dockette/coder` is meant to drop into a Coder Terraform template so new workspaces already have a sane dev stack.
13+
1014
## Usage
1115

16+
Point your workspace image at this tag (or build from `fx/Dockerfile` if you fork):
17+
1218
```diff
1319
resource "docker_container" "workspace" {
1420
count = data.coder_workspace.me.start_count
@@ -18,28 +24,30 @@ resource "docker_container" "workspace" {
1824
}
1925
```
2026

21-
## Documentation
22-
23-
### From base (codercom/example-node:ubuntu)
27+
## Images
2428

25-
Ubuntu Noble, Node.js LTS, Yarn, Docker, git, curl, htop, jq, vim, wget, sudo, `coder` user.
29+
### `dockette/coder:fx`
2630

27-
### Added in fx
31+
So you’re replacing the plain enterprise base with the same foundation plus our layers: Node/npm, PHP 8.5, Composer, Deno, Bun, browser automation, and the CLIs listed below.
2832

29-
mc, nano, PHP 8.5 (cli, curl, intl, mbstring, readline, xml, zip), Composer, GitHub CLI (gh), Deno, Bun, Claude CLI, OpenCode, and npm globals: vibe-kanban, @openai/codex, @github/copilot.
33+
**Base:** `codercom/enterprise-base:ubuntu` (Ubuntu, `coder` user, usual Coder expectations).
3034

31-
### Coder template
32-
33-
Use this image in your Terraform template so workspaces start with all tools preinstalled: set `docker_image` / `docker_container` to `dockette/coder:fx`, or use a Dockerfile that starts with `FROM dockette/coder:fx`. Your `startup_script` can be reduced to first-run init (e.g. copy `/etc/skel` into home, touch `~/.init_done`); no need to install packages or run install scripts.
34-
35-
### PATH
36-
37-
Deno and Bun are installed under `/usr/local`. Their env and `bin` dirs are appended to `/etc/profile` so all login shells get `DENO_INSTALL`, `BUN_INSTALL`, and PATH.
35+
- **Node.js** (includes **npm**) via Nodesource (**Node 22** in this image).
36+
- **Shell:** `mc`, `nano`, `tmux`.
37+
- **PHP 8.5** (Ondrej PPA): CLI + common extensions (curl, intl, mbstring, mysql, pgsql, redis, xml, zip, imagick, etc.).
38+
- **Composer**, **GitHub CLI (`gh`)**.
39+
- **Deno** and **Bun** under `/usr/local`. `/etc/profile` sets `DENO_INSTALL`, `BUN_INSTALL`, and PATH for login shells.
40+
- **Claude** and **OpenCode** installers (best-effort copy to `/usr/local/bin` when present).
41+
- **npm globals:** `@openai/codex`, `@github/copilot`.
42+
- **Chrome libraries** plus **agent-browser** (installs its Chromium).
3843

3944
## Development
4045

41-
See [how to contribute](https://contributte.org/contributing.html) to this package.
46+
```bash
47+
make build
48+
make test
49+
```
4250

4351
-----
4452

45-
Consider to [support](https://github.com/sponsors/f3l1x) **f3l1x**. Also thank you for using this package.
53+
Consider supporting [f3l1x on GitHub Sponsors](https://github.com/sponsors/f3l1x) if you rely on this. Thanks for using it.

fx/Dockerfile

Lines changed: 48 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,69 @@
1-
FROM codercom/example-node:ubuntu
1+
FROM codercom/enterprise-base:ubuntu
22

3-
USER root
3+
ENV DENO_INSTALL=/usr/local
4+
ENV BUN_INSTALL=/usr/local
5+
ENV NODE_VERSION=22
46

5-
# npm: user-local global directory
6-
RUN mkdir -p ~/.npm-global && \
7-
npm config set prefix ~/.npm-global
7+
USER root
88

9-
# Apt: mc, nano, PHP 8.5 (Ondrej), GitHub CLI
10-
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && \
11-
apt-get install -y --no-install-recommends mc nano tmux software-properties-common ca-certificates && \
9+
RUN apt update && apt dist-upgrade -y && \
10+
mkdir -p -m 755 /etc/apt/keyrings && \
11+
apt install -y curl git wget htop jq && \
12+
# NODE ######################################################################
13+
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && \
14+
apt install -y nodejs && \
15+
# PHP #######################################################################
1216
add-apt-repository -y ppa:ondrej/php && \
13-
apt-get update -y && \
14-
apt-get install -y --no-install-recommends \
17+
apt update -y && \
18+
apt install -y --no-install-recommends \
1519
php8.5-cli php8.5-common php8.5-curl php8.5-gd php8.5-imap php8.5-intl \
1620
php8.5-mailparse php8.5-mbstring php8.5-mysql php8.5-pgsql php8.5-phpdbg \
1721
php8.5-readline php8.5-redis php8.5-soap php8.5-sqlite3 php8.5-xml \
1822
php8.5-zip php8.5-bcmath php8.5-apcu php8.5-imagick && \
19-
mkdir -p -m 755 /etc/apt/keyrings && \
20-
(out=$(mktemp) && wget -nv -O"$out" https://cli.github.com/packages/githubcli-archive-keyring.gpg && \
21-
cat "$out" > /etc/apt/keyrings/githubcli-archive-keyring.gpg && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg) && \
23+
echo 'variables_order = "EGPCS"' > /etc/php/8.5/cli/conf.d/99-coder.ini && \
24+
# COMPOSER ##################################################################
25+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
26+
# GITHUB CLI ################################################################
27+
wget -qO /tmp/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \
28+
install -D -m 644 /tmp/githubcli-archive-keyring.gpg /etc/apt/keyrings/githubcli-archive-keyring.gpg && \
2229
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 && \
23-
apt-get update -y && \
24-
apt-get install -y --no-install-recommends gh && \
25-
apt-get clean && rm -rf /var/lib/apt/lists/*
26-
27-
# PHP: custom config
28-
RUN echo 'variables_order = "EGPCS"' > /etc/php/8.5/cli/conf.d/99-coder.ini
29-
30-
# Composer (system-wide)
31-
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
32-
33-
# Deno (system-wide)
34-
ENV DENO_INSTALL=/usr/local
35-
RUN curl -fsSL https://deno.land/install.sh | sh
36-
37-
# Bun (system-wide)
38-
ENV BUN_INSTALL=/usr/local
39-
RUN curl -fsSL https://bun.sh/install | bash
40-
41-
# Claude CLI
42-
RUN curl -fsSL https://claude.ai/install.sh | bash || true && \
30+
apt update -y && \
31+
apt install -y --no-install-recommends gh && \
32+
# DENO ######################################################################
33+
curl -fsSL https://deno.land/install.sh | sh && \
34+
# BUN #######################################################################
35+
curl -fsSL https://bun.sh/install | bash && \
36+
# CLAUDE ####################################################################
37+
(curl -fsSL https://claude.ai/install.sh | bash || true) && \
4338
if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi && \
44-
if [ -f /root/bin/claude ]; then cp /root/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi
45-
46-
# OpenCode CLI
47-
RUN curl -fsSL https://opencode.ai/install | bash || true && \
48-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /usr/local/bin/opencode && chmod +x /usr/local/bin/opencode; fi
49-
50-
# Codex
51-
RUN npm install -g @openai/codex
52-
53-
# Copilot
54-
RUN npm install -g @github/copilot
55-
56-
# Chrome dependencies
57-
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && \
58-
apt-get install -y --no-install-recommends \
39+
if [ -f /root/bin/claude ]; then cp /root/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi && \
40+
# OPENCODE ##################################################################
41+
(curl -fsSL https://opencode.ai/install | bash || true) && \
42+
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /usr/local/bin/opencode && chmod +x /usr/local/bin/opencode; fi && \
43+
# NPM: CODEX, COPILOT #######################################################
44+
npm install -g @openai/codex @github/copilot && \
45+
# CHROME LIBS (AGENT-BROWSER) ###############################################
46+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5947
libnspr4 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libatspi2.0-0 \
6048
libcups2t64 libxshmfence1 libgbm1 libpango-1.0-0 libpangocairo-1.0-0 \
6149
libasound2t64 libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
6250
libxi6 libgtk-3-0t64 libcairo2 libcairo-gobject2 libgdk-pixbuf-2.0-0 \
6351
libatk1.0-0 libxrender1 libfontconfig1 libdbus-1-3 libxcb1 libxext6 libx11-6 && \
64-
apt-get clean && rm -rf /var/lib/apt/lists/*
65-
66-
# Agent Browser: install + download Chrome
67-
RUN npm install -g agent-browser && \
68-
agent-browser install
69-
70-
# PATHS
71-
RUN echo '' >> /etc/profile && \
72-
echo '# coder-env: Deno, Bun' >> /etc/profile && \
52+
npm install -g agent-browser && \
53+
agent-browser install && \
54+
# PROFILE (DENO, BUN PATH) ##################################################
55+
echo '' >> /etc/profile && \
56+
echo '# Deno, Bun' >> /etc/profile && \
7357
echo 'export DENO_INSTALL="${DENO_INSTALL:-/usr/local}"' >> /etc/profile && \
7458
echo 'export BUN_INSTALL="${BUN_INSTALL:-/usr/local}"' >> /etc/profile && \
7559
echo '[ -d "$DENO_INSTALL/bin" ] && export PATH="$DENO_INSTALL/bin:$PATH"' >> /etc/profile && \
76-
echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile
60+
echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile && \
61+
# CLEANUP ###################################################################
62+
apt clean -y && \
63+
apt autoclean -y && \
64+
apt remove -y wget && \
65+
apt autoremove -y && \
66+
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*
7767

7868
WORKDIR /home/coder
7969

0 commit comments

Comments
 (0)