-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.warp
More file actions
155 lines (138 loc) · 6.2 KB
/
Dockerfile.warp
File metadata and controls
155 lines (138 loc) · 6.2 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# =============================================================================
# Docker Development Environment for ad-blocking toolkit
# Includes: .NET 10, Deno 2.x, Python 3.13, Rust 1.85+, PowerShell 7
# =============================================================================
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble
# Build arguments for version control
ARG DENO_VERSION=2.6.3
ARG PYTHON_VERSION=3.13
ARG RUST_VERSION=1.85
ARG PWSH_VERSION=7.5.4
# Environment variables
ENV DEBIAN_FRONTEND=noninteractive \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
DOTNET_NOLOGO=1 \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \
DENO_DIR=/root/.deno \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
CARGO_HOME=/root/.cargo \
RUSTUP_HOME=/root/.rustup \
PATH="/root/.deno/bin:/root/.cargo/bin:${PATH}"
# =============================================================================
# Base dependencies
# =============================================================================
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gnupg \
wget \
ca-certificates \
apt-transport-https \
software-properties-common \
lsb-release \
git \
build-essential \
pkg-config \
libssl-dev \
jq \
zip \
unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# =============================================================================
# Deno 2.6.3
# =============================================================================
RUN curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh -s v${DENO_VERSION} && \
deno --version
# Pre-cache NPM dependencies used by the TypeScript compiler
RUN deno cache npm:@adguard/hostlist-compiler@^1.0.39 && \
deno cache npm:yaml@^2.8.2 && \
deno cache npm:@iarna/toml@^2.2.5 && \
deno cache npm:chalk@^5.6.2 && \
deno cache npm:cli-table3@^0.6.5 && \
deno cache npm:ora@^9.0.0 && \
deno cache npm:figlet@^1.9.4 && \
deno cache npm:@inquirer/prompts@^8.1.0 && \
deno cache npm:commander@^14.0.2 && \
deno cache npm:inquirer@^13.1.0 && \
deno cache npm:axios@^1.13.2 && \
deno cache npm:axios-retry@^4.5.0 && \
deno cache npm:@linear/sdk@^68.1.0 && \
deno cache npm:dotenv@^17.2.3 && \
deno cache npm:marked@^17.0.1
# Create a wrapper script for hostlist-compiler
RUN echo '#!/bin/sh\nexec deno run --allow-read --allow-write --allow-env --allow-net --allow-run npm:@adguard/hostlist-compiler "$@"' > /usr/local/bin/hostlist-compiler && \
chmod +x /usr/local/bin/hostlist-compiler
# =============================================================================
# Python 3.13
# =============================================================================
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
python3-dev \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& pip3 install --no-cache-dir --break-system-packages \
pip>=24.0 \
setuptools>=61.0 \
wheel \
pytest>=7.0 \
pytest-cov>=4.0 \
mypy>=1.0 \
ruff>=0.1.0 \
pyyaml>=6.0 \
tomlkit>=0.12.0 \
types-PyYAML>=6.0 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# =============================================================================
# Rust 1.85+ (required by Cargo.toml)
# =============================================================================
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} && \
. "$CARGO_HOME/env" && \
rustup component add clippy rustfmt && \
rustc --version && \
cargo --version
# =============================================================================
# PowerShell 7.5.4
# =============================================================================
RUN wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y --no-install-recommends powershell && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
pwsh --version
# Install PowerShell modules (Pester for testing, PSScriptAnalyzer for linting)
RUN pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted" && \
pwsh -Command "Install-Module -Name Pester -MinimumVersion 5.0 -Scope AllUsers -Force" && \
pwsh -Command "Install-Module -Name PSScriptAnalyzer -Scope AllUsers -Force" && \
pwsh -Command "Get-Module -ListAvailable Pester, PSScriptAnalyzer"
# =============================================================================
# YAML/TOML tools (yq for shell scripts)
# =============================================================================
RUN wget -q "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64" -O /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq && \
yq --version
# =============================================================================
# .NET workload and tool installation
# =============================================================================
RUN dotnet --info
# =============================================================================
# Verification and final setup
# =============================================================================
RUN echo "=== Installed Versions ===" && \
echo "dotnet: $(dotnet --version)" && \
echo "deno: $(deno --version | head -1)" && \
echo "python: $(python --version)" && \
echo "pip: $(pip --version)" && \
echo "rustc: $(rustc --version)" && \
echo "cargo: $(cargo --version)" && \
echo "pwsh: $(pwsh --version)" && \
echo "git: $(git --version)" && \
echo "yq: $(yq --version)" && \
echo "=========================="
# =============================================================================
# Working directory
# =============================================================================
WORKDIR /workspace
# Default command
CMD ["/bin/bash"]