Skip to content

Commit 328fcbd

Browse files
committed
Add Homebrew, vim, and developer environment to containers
- Install Homebrew (pinned SHA) in both gaia-linux and gaia-dev - Add vim with developer .vimrc (syntax highlighting, search, indentation) - Set EDITOR/VISUAL to vim, TERM/COLORTERM for true color support - Fix .vimrc ownership with COPY --chown=gaia:gaia - Add 'file' package required by Homebrew installer - Drop arm64 from CI builds (Homebrew on arm64 via QEMU is unreliable) - Add tests for Homebrew presence and .vimrc ownership - Bump versions: gaia-linux 1.0.0→1.0.1, gaia-dev 1.2.0→1.2.1
1 parent acef663 commit 328fcbd

7 files changed

Lines changed: 136 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
with:
119119
context: .
120120
file: gaia-linux/Dockerfile
121-
platforms: linux/amd64,linux/arm64
121+
platforms: linux/amd64
122122
push: true
123123
tags: ${{ steps.meta.outputs.tags }}
124124
labels: ${{ steps.meta.outputs.labels }}
@@ -230,7 +230,7 @@ jobs:
230230
with:
231231
context: .
232232
file: gaia-dev/Dockerfile
233-
platforms: linux/amd64,linux/arm64
233+
platforms: linux/amd64
234234
push: true
235235
tags: ${{ steps.meta.outputs.tags }}
236236
labels: ${{ steps.meta.outputs.labels }}

.vimrc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
" === Syntax & Colors ===
2+
syntax on
3+
filetype plugin indent on
4+
set background=dark
5+
colorscheme desert
6+
7+
" === UI ===
8+
set number
9+
set ruler
10+
set laststatus=2
11+
set showcmd
12+
set showmatch
13+
set cursorline
14+
set wildmenu
15+
set wildmode=longest:full,full
16+
set scrolloff=5
17+
set signcolumn=yes
18+
19+
" === Search ===
20+
set hlsearch
21+
set incsearch
22+
set ignorecase
23+
set smartcase
24+
25+
" === Indentation ===
26+
set autoindent
27+
set smartindent
28+
set expandtab
29+
set tabstop=4
30+
set shiftwidth=4
31+
set softtabstop=4
32+
33+
" === Encoding & Files ===
34+
set encoding=utf-8
35+
set fileencoding=utf-8
36+
set noswapfile
37+
set nobackup
38+
set nowritebackup
39+
set hidden
40+
41+
" === Input ===
42+
set backspace=indent,eol,start
43+
set mouse=a
44+
set ttimeoutlen=50
45+
46+
" === Performance ===
47+
set ttyfast
48+
set lazyredraw

VERSION.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"gaia-linux": "1.0.0",
3-
"gaia-dev": "1.2.0"
2+
"gaia-linux": "1.0.1",
3+
"gaia-dev": "1.2.1"
44
}

gaia-dev/Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG DEBIAN_FRONTEND=noninteractive
1818
# Install system dependencies (NO Python - will be managed by uv)
1919
RUN apt-get update && apt-get install -y --no-install-recommends \
2020
# Core tools
21-
ca-certificates curl gnupg git procps sudo \
21+
ca-certificates curl gnupg git procps sudo file \
2222
# Shell and utilities
2323
fzf zsh man-db unzip nano vim wget less \
2424
# JSON processor
@@ -71,6 +71,15 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
7171
USER $USERNAME
7272
WORKDIR /home/$USERNAME
7373

74+
# Install Homebrew
75+
ENV HOMEBREW_NO_ANALYTICS=1
76+
ENV HOMEBREW_NO_AUTO_UPDATE=1
77+
ENV HOMEBREW_NO_INSTALL_CLEANUP=1
78+
RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/6d5e2670d07961e7985d2079a2f0a484420f3c38/install.sh)"
79+
80+
# Configure Vim
81+
COPY --chown=gaia:gaia .vimrc /home/gaia/.vimrc
82+
7483
# Install oh-my-zsh with useful plugins
7584
ARG ZSH_IN_DOCKER_VERSION=1.2.0
7685
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
@@ -96,8 +105,12 @@ RUN ln -sf /home/gaia/.venv/bin/python /home/gaia/.local/bin/python
96105

97106
# Configure environment
98107
ENV SHELL=/bin/zsh
108+
ENV TERM=xterm-256color
109+
ENV COLORTERM=truecolor
110+
ENV EDITOR=vim
111+
ENV VISUAL=vim
99112
ENV VIRTUAL_ENV=/home/gaia/.venv
100-
ENV PATH="/home/gaia/.venv/bin:/home/gaia/.cargo/bin:/home/gaia/.local/bin:$PATH"
113+
ENV PATH="/home/gaia/.venv/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/gaia/.cargo/bin:/home/gaia/.local/bin:$PATH"
101114

102115
ENV DEVCONTAINER=true
103116

gaia-linux/Dockerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2525
# Install minimal runtime dependencies
2626
RUN apt-get update && apt-get install -y --no-install-recommends \
2727
# Core runtime
28-
ca-certificates curl sudo procps \
28+
ca-certificates curl sudo procps file \
2929
# Shell (needed for entrypoint and user interaction)
3030
zsh \
3131
# Git (required for oh-my-zsh installation)
@@ -34,6 +34,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3434
build-essential \
3535
# Audio processing for GAIA voice features
3636
libportaudio2 portaudio19-dev ffmpeg \
37+
# Editor
38+
vim \
3739
&& apt-get clean \
3840
&& rm -rf /var/lib/apt/lists/*
3941

@@ -69,6 +71,15 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
6971
USER $USERNAME
7072
WORKDIR /source
7173

74+
# Install Homebrew
75+
ENV HOMEBREW_NO_ANALYTICS=1
76+
ENV HOMEBREW_NO_AUTO_UPDATE=1
77+
ENV HOMEBREW_NO_INSTALL_CLEANUP=1
78+
RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/6d5e2670d07961e7985d2079a2f0a484420f3c38/install.sh)"
79+
80+
# Configure Vim
81+
COPY --chown=gaia:gaia .vimrc /home/gaia/.vimrc
82+
7283
# Install oh-my-zsh with useful plugins
7384
ARG ZSH_IN_DOCKER_VERSION=1.2.0
7485
RUN sh -c "$(curl -fsSL https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
@@ -79,7 +90,11 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
7990

8091
# Configure environment
8192
ENV SHELL=/bin/zsh
82-
ENV PATH="/home/gaia/.cargo/bin:/home/gaia/.local/bin:$PATH"
93+
ENV TERM=xterm-256color
94+
ENV COLORTERM=truecolor
95+
ENV EDITOR=vim
96+
ENV VISUAL=vim
97+
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/gaia/.cargo/bin:/home/gaia/.local/bin:$PATH"
8398

8499
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
85100
CMD ["zsh"]

tests/test_dockerfile.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,33 @@ def test_ffmpeg_installed(self, project_root):
111111
assert result.returncode == 0
112112
assert "ffmpeg version" in result.stdout
113113

114+
def test_homebrew_installed(self, project_root):
115+
"""Container must have Homebrew on PATH."""
116+
result = subprocess.run(
117+
["docker", "run", "--rm",
118+
"-e", "LEMONADE_BASE_URL=http://test",
119+
"-e", "SKIP_INSTALL=true",
120+
"gaia-linux:test", "brew", "--version"],
121+
capture_output=True,
122+
text=True
123+
)
124+
assert result.returncode == 0
125+
assert "Homebrew" in result.stdout
126+
127+
def test_vimrc_owned_by_gaia(self, project_root):
128+
"""Container must have .vimrc owned by gaia user."""
129+
result = subprocess.run(
130+
["docker", "run", "--rm",
131+
"-e", "LEMONADE_BASE_URL=http://test",
132+
"-e", "SKIP_INSTALL=true",
133+
"gaia-linux:test", "stat", "-c", "%U:%G", "/home/gaia/.vimrc"],
134+
capture_output=True,
135+
text=True
136+
)
137+
assert result.returncode == 0
138+
last_line = result.stdout.strip().splitlines()[-1]
139+
assert last_line == "gaia:gaia"
140+
114141

115142
class TestDockerfileOptimization:
116143
"""Test that Dockerfile follows best practices."""

tests/test_dockerfile_dev.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,31 @@ def test_gaia_user_exists(self, project_root):
116116
last_line = result.stdout.strip().splitlines()[-1]
117117
assert last_line == "gaia"
118118

119+
def test_homebrew_installed(self, project_root):
120+
"""Container must have Homebrew on PATH."""
121+
result = subprocess.run(
122+
["docker", "run", "--rm",
123+
"-e", "LEMONADE_BASE_URL=http://test",
124+
"gaia-dev:test", "brew", "--version"],
125+
capture_output=True,
126+
text=True
127+
)
128+
assert result.returncode == 0
129+
assert "Homebrew" in result.stdout
130+
131+
def test_vimrc_owned_by_gaia(self, project_root):
132+
"""Container must have .vimrc owned by gaia user."""
133+
result = subprocess.run(
134+
["docker", "run", "--rm",
135+
"-e", "LEMONADE_BASE_URL=http://test",
136+
"gaia-dev:test", "stat", "-c", "%U:%G", "/home/gaia/.vimrc"],
137+
capture_output=True,
138+
text=True
139+
)
140+
assert result.returncode == 0
141+
last_line = result.stdout.strip().splitlines()[-1]
142+
assert last_line == "gaia:gaia"
143+
119144

120145
class TestGaiaSourceCode:
121146
"""Test GAIA source code cloning and dependencies."""

0 commit comments

Comments
 (0)