Files
osmedeus/build/docker/Dockerfile.toolbox-nix
T
j3ssie 88e3552a63 refactor: simplify release workflows and add local-release target
- Remove unnecessary goreleaser skip flags from manual-release workflow
- Add local-release make target for testing macOS and Linux ARM64 builds
- Refactor Dockerfile.toolbox to use direct-fetch with Ubuntu 24.04 base
- Create Dockerfile.toolbox-nix for Nix-based installation variant
2026-01-21 14:41:02 +08:00

80 lines
2.2 KiB
Docker

# Osmedeus Toolbox Dockerfile
# Full-featured image with all security tools pre-installed via Nix and direct-fetch
# Based on Ubuntu 24.04 LTS with Python3 and Nix package manager
FROM ubuntu:24.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies and Python3
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
git \
unzip \
jq \
bash \
xz-utils \
python3 \
python3-pip \
python3-venv \
chromium-browser \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Create symlink for python
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Install Nix package manager (single-user mode for Docker)
RUN mkdir -m 0755 /nix && \
curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
# Enable Nix experimental features for flakes
RUN mkdir -p /root/.config/nix && \
echo "experimental-features = nix-command flakes" > /root/.config/nix/nix.conf
# Set up Nix environment
ENV PATH="/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:${PATH}"
ENV NIX_PATH="/root/.nix-defexpr/channels"
# Source Nix profile in bashrc
RUN echo '. /root/.nix-profile/etc/profile.d/nix.sh' >> /root/.bashrc
# Create base directories
RUN mkdir -p /root/osmedeus-base /root/workspaces-osmedeus
WORKDIR /root
# Install osmedeus via official install script
RUN curl -sSL https://www.osmedeus.org/install.sh | bash
# Set up PATH for osmedeus and external binaries
ENV PATH="/root/go/bin:/root/osmedeus-base/external-binaries:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:${PATH}"
# Use bash shell for subsequent commands to source nix profile
SHELL ["/bin/bash", "-lc"]
# Install binaries via Nix (nix-build-install)
RUN . /root/.nix-profile/etc/profile.d/nix.sh && \
osmedeus install binary --all --nix-build-install || true
# Install remaining binaries via direct-fetch (including optional ones)
RUN osmedeus install binary --all --install-optional || true
# Run osmedeus health check to verify installation
RUN osmedeus health || true
# Expose default server port
EXPOSE 8002
# Use bash as default shell
SHELL ["/bin/bash", "-c"]
# Default entrypoint
ENTRYPOINT ["osmedeus"]
# Default command shows help
CMD ["--help"]