-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
51 lines (44 loc) · 1.66 KB
/
Dockerfile.test
File metadata and controls
51 lines (44 loc) · 1.66 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
FROM debian:bookworm-slim
# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# Install basic requirements
RUN apt-get update && apt-get install -y \
curl \
git \
wget \
sudo \
python3 \
python3-pip \
zsh \
vim \
build-essential \
ca-certificates \
locales \
jq \
&& rm -rf /var/lib/apt/lists/*
# Set up locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# Create test user
RUN useradd -m -s /bin/zsh -G sudo testuser && \
echo "testuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/testuser
# Switch to test user
USER testuser
WORKDIR /home/testuser
# Copy dotfiles
COPY --chown=testuser:testuser . /home/testuser/dotfiles
# Run verification script in foreground
ENTRYPOINT ["/bin/bash", "-c", "cd /home/testuser/dotfiles && bash install.sh && \
echo 'Running verification tests...' && \
TESTS_PASSED=true && \
echo 'Testing tmux configuration...' && \
if [ -f ~/.tmux.conf ]; then echo 'Tmux config found! ✅'; else echo 'Tmux config missing! ❌'; TESTS_PASSED=false; fi && \
echo 'Testing lazygit...' && \
if [ -f ~/.local/bin/lazygit ]; then echo 'lazygit installed! ✅'; else echo 'lazygit not found! ❌'; TESTS_PASSED=false; fi && \
echo 'Testing lazydocker...' && \
if [ -f ~/.local/bin/lazydocker ]; then echo 'lazydocker installed! ✅'; else echo 'lazydocker not found! ❌'; TESTS_PASSED=false; fi && \
echo 'Test results:' && \
if [ \"$TESTS_PASSED\" = \"true\" ]; then echo 'All tests passed! ✅'; exit 0; else echo 'Some tests failed! ❌'; exit 1; fi"]