-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (55 loc) · 1.82 KB
/
Dockerfile
File metadata and controls
67 lines (55 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Smoke test container matching CI environment
# Reproduces .github/workflows/smoke.yml locally for faster iteration
#
# Usage:
# make smoke-build # Build and run full smoke test
# make smoke-lint # Run linting only
# make smoke-shell # Interactive shell for debugging
#
FROM ubuntu:24.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-256color
# Install base dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
file \
git \
locales \
procps \
sudo \
unzip \
zsh \
&& rm -rf /var/lib/apt/lists/*
# Set up locale (required for some tools)
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# Create test user with sudo access (matches CI runner user setup)
RUN useradd -m -s /bin/zsh -G sudo tester && \
echo "tester ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Switch to test user for Homebrew installation
USER tester
ENV HOME=/home/tester
WORKDIR /home/tester
# Install Homebrew (Linux)
RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add Homebrew to PATH (must match installer output)
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
RUN brew --version
ENV HOMEBREW_NO_AUTO_UPDATE=1
ENV HOMEBREW_NO_ANALYTICS=1
# Install core tools via Homebrew (matching CI)
RUN brew install chezmoi neovim
# Install mise
RUN curl https://mise.run | sh
ENV PATH="/home/tester/.local/bin:${PATH}"
# Install pre-commit for linting stage
RUN brew install pre-commit
# Copy dotfiles source
COPY --chown=tester:tester . /tmp/dotfiles
WORKDIR /tmp/dotfiles
# Default: run full smoke test (lint + build)
CMD ["/tmp/dotfiles/scripts/smoke-test-docker.sh"]