-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
46 lines (34 loc) · 942 Bytes
/
Copy pathDockerfile.test
File metadata and controls
46 lines (34 loc) · 942 Bytes
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
# Test Dockerfile for dotfiles installation
# Tests installation in a clean Ubuntu environment
FROM ubuntu:22.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install basic dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
jq \
sudo \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m -s /bin/bash testuser && \
echo "testuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Switch to non-root user
USER testuser
WORKDIR /home/testuser
# Set up environment
ENV HOME=/home/testuser
ENV USER=testuser
# Copy dotfiles repository
COPY --chown=testuser:testuser . /home/testuser/dotfiles
WORKDIR /home/testuser/dotfiles
# Run installation
RUN ./bootstrap.sh --verbose
# Validate installation
RUN ./scripts/validate-install.sh
# Run health check
RUN ./scripts/health-check.sh || true
# Set default command
CMD ["/bin/bash"]