Add installer script and test installation Docker image
- install.sh: Interactive installer that: - Checks Python version and prerequisites - Creates virtual environment at ~/.cmdforge-venv - Installs CmdForge with all dependencies - Sets up PATH in .bashrc/.zshrc - Creates tool wrappers - Optionally installs 27 example tools - Supports --yes for non-interactive mode - Dockerfile.test-install: Fresh Ubuntu image for testing - Simulates a new computer (CmdForge source present but not installed) - Non-root user (testuser) for realistic permissions - Run interactively to test the full installation experience Usage: docker build -f Dockerfile.test-install -t cmdforge-test-install . docker run -it --rm cmdforge-test-install # Inside: ./install.sh Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
# CmdForge - Test Installation Container
|
||||
#
|
||||
# This container simulates a fresh computer for testing the installation process.
|
||||
# CmdForge source is available but NOT installed - you run the installer yourself.
|
||||
#
|
||||
# Build:
|
||||
# docker build -f Dockerfile.test-install -t cmdforge-test-install .
|
||||
#
|
||||
# Run:
|
||||
# docker run -it --rm cmdforge-test-install
|
||||
#
|
||||
# Inside the container:
|
||||
# ./install.sh # Run the installer
|
||||
# cmdforge ui # Launch the UI
|
||||
# cmdforge providers install # Set up an AI provider
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
||||
LABEL maintainer="rob"
|
||||
LABEL description="CmdForge installation test environment"
|
||||
|
||||
# Prevent interactive prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install system dependencies (what a typical dev machine would have)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Python
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
# Common tools a developer would have
|
||||
git \
|
||||
curl \
|
||||
vim \
|
||||
less \
|
||||
# For providers that need browser auth
|
||||
firefox \
|
||||
xdg-utils \
|
||||
# X11 for display forwarding
|
||||
libx11-6 \
|
||||
libxext6 \
|
||||
libxrender1 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create a non-root user (simulates typical user setup)
|
||||
RUN useradd -m -s /bin/bash testuser
|
||||
USER testuser
|
||||
WORKDIR /home/testuser
|
||||
|
||||
# Copy CmdForge source (owned by testuser)
|
||||
COPY --chown=testuser:testuser . /home/testuser/CmdForge
|
||||
|
||||
# Set up PATH for local bin (where cmdforge wrappers go)
|
||||
RUN mkdir -p /home/testuser/.local/bin
|
||||
ENV PATH="/home/testuser/.local/bin:${PATH}"
|
||||
|
||||
# Make install script executable
|
||||
RUN chmod +x /home/testuser/CmdForge/install.sh
|
||||
|
||||
# Welcome message
|
||||
RUN echo '\n\
|
||||
echo ""\n\
|
||||
echo "================================================================="\n\
|
||||
echo " CmdForge Installation Test Environment"\n\
|
||||
echo "================================================================="\n\
|
||||
echo ""\n\
|
||||
echo " CmdForge source is in: ~/CmdForge"\n\
|
||||
echo " To install, run:"\n\
|
||||
echo ""\n\
|
||||
echo " cd ~/CmdForge"\n\
|
||||
echo " ./install.sh"\n\
|
||||
echo ""\n\
|
||||
echo " After installation:"\n\
|
||||
echo " cmdforge ui # Launch the UI"\n\
|
||||
echo " cmdforge list # List tools"\n\
|
||||
echo " cmdforge providers install # Set up AI provider"\n\
|
||||
echo ""\n\
|
||||
echo "================================================================="\n\
|
||||
echo ""\n\
|
||||
' >> /home/testuser/.bashrc
|
||||
|
||||
WORKDIR /home/testuser/CmdForge
|
||||
|
||||
# Start in interactive bash
|
||||
CMD ["/bin/bash"]
|
||||
Reference in New Issue
Block a user