-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathDockerfile.test
More file actions
43 lines (34 loc) · 1.08 KB
/
Dockerfile.test
File metadata and controls
43 lines (34 loc) · 1.08 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
FROM ubuntu:22.04
# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Basic deps
RUN apt-get update && apt-get install -y \
curl \
git \
sudo \
build-essential \
procps \
file \
&& rm -rf /var/lib/apt/lists/*
# Create test user with sudo
RUN useradd -m -s /bin/bash testuser && \
echo "testuser:test" | chpasswd && \
usermod -aG sudo testuser && \
echo "testuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Install Go for building (detect arch)
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "arm64" ]; then GO_ARCH="arm64"; else GO_ARCH="amd64"; fi && \
curl -sL "https://go.dev/dl/go1.23.4.linux-${GO_ARCH}.tar.gz" | tar -C /usr/local -xzf -
ENV PATH="/usr/local/go/bin:${PATH}"
# Copy installer source
WORKDIR /app
COPY installer/ ./installer/
# Build the installer
RUN cd installer && go build -o /usr/local/bin/gentleman.dots ./cmd/gentleman-installer
# Switch to test user
USER testuser
WORKDIR /home/testuser
# Set up minimal environment
ENV HOME=/home/testuser
ENV TERM=xterm-256color
CMD ["/usr/local/bin/gentleman.dots"]