-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (49 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (49 loc) · 1.83 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
# Use a recent Ubuntu LTS version as the base image
FROM ubuntu:22.04
# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install minimal prerequisites for bootstrapping
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
git \
curl \
zsh \
stow \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN adduser --disabled-password --gecos "" myuser && \
usermod -aG sudo myuser
RUN echo 'myuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Switch to the non-root user
USER myuser
WORKDIR /home/myuser
# --- Bootstrap Step 1: Install GUM ---
# Install gum via its .deb package to avoid Go versioning issues.
RUN wget https://github.com/charmbracelet/gum/releases/download/v0.13.0/gum_0.13.0_amd64.deb && \
sudo dpkg -i gum_0.13.0_amd64.deb && \
rm gum_0.13.0_amd64.deb
# Copy the entire dotfiles repository
COPY --chown=myuser:myuser . /home/myuser/dotfiles
# Set working directory
WORKDIR /home/myuser/dotfiles
# --- Bootstrap Step 2: Stow BIN ---
# Stow the 'bin' directory first to make all helper scripts available on the PATH.
RUN stow -D bin && stow bin
ENV PATH="/home/myuser/.config/bin:${PATH}"
# Make all installer scripts executable
RUN chmod +x ./scripts/install/phases/*.zsh
RUN chmod +x ./scripts/test/verify-installation.sh
# --- Execute Test ---
# Now that helper scripts are on the PATH, run the installation phases directly.
ENV NON_INTERACTIVE_MODE=true
RUN ./scripts/install/phases/00-base-ubuntu.zsh && \
./scripts/install/phases/03-system-foundation.zsh && \
./scripts/install/phases/04-development-core.zsh && \
./scripts/install/phases/07-config-stow.zsh
# --- Verify ---
# Run the verification script to confirm tools are installed.
RUN ./scripts/test/verify-installation.sh
# Set the default command
CMD ["/usr/bin/zsh"]