aboutsummaryrefslogtreecommitdiffstats
path: root/images/ubuntu/Dockerfile
blob: 83539b4e72dcb94a18b6bee18fe8bf39b83d4a70 (plain) (blame)
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# Ubuntu Development Environment
# Contains common development tools for various programming languages and workflows

# =============================================================================
# BASE STAGE - Minimal Ubuntu with systemd
# =============================================================================
FROM ubuntu:24.04 AS base

LABEL maintainer="sinitax"
LABEL description="Ubuntu with systemd"

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

RUN apt-get update && apt-get install -y \
    systemd-sysv \
    && rm -rf /var/lib/apt/lists/*

# Enable systemd-networkd and systemd-resolved
RUN systemctl enable systemd-networkd systemd-resolved

# Configure eth0 with DHCP (IPv4 and IPv6)
RUN printf '[Match]\nName=eth0\n\n[Network]\nDHCP=yes\nIPv6AcceptRA=yes\n' > /etc/systemd/network/20-eth0.network

# Configure DNS via systemd-resolved
RUN mkdir -p /etc/systemd/resolved.conf.d && \
    printf '[Resolve]\nDNS=8.8.8.8 8.8.4.4 1.1.1.1\n' > /etc/systemd/resolved.conf.d/dns.conf

# Set up resolv.conf symlink and hostname on boot (can't modify during Docker build)
RUN printf 'L+ /etc/resolv.conf - - - - /run/systemd/resolve/stub-resolv.conf\nf /etc/hostname - - - - claude-vm\n' > /etc/tmpfiles.d/claude-vm.conf

CMD ["/sbin/init"]

# =============================================================================
# FULL STAGE - Complete development environment
# =============================================================================
FROM base AS full

LABEL description="Ubuntu development environment with common tools"

# Update and install base packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
    # Build essentials
    build-essential \
    gcc \
    g++ \
    make \
    cmake \
    ninja-build \
    autoconf \
    automake \
    libtool \
    pkg-config \
    # Version control
    git \
    git-lfs \
    subversion \
    mercurial \
    # Python
    python3 \
    python3-pip \
    python3-venv \
    python3-dev \
    # Java
    default-jdk \
    maven \
    gradle \
    # Go
    golang-go \
    # Ruby
    ruby \
    ruby-dev \
    # PHP
    php \
    php-cli \
    php-curl \
    php-mbstring \
    php-xml \
    composer \
    # Perl
    perl \
    # Lua
    lua5.4 \
    luarocks \
    # Editors
    vim \
    neovim \
    nano \
    emacs-nox \
    # Shell tools
    zsh \
    fish \
    tmux \
    screen \
    # Debugging and profiling
    gdb \
    lldb \
    valgrind \
    strace \
    ltrace \
    # Network tools
    curl \
    wget \
    httpie \
    netcat-openbsd \
    nmap \
    tcpdump \
    dnsutils \
    iputils-ping \
    iproute2 \
    openssh-client \
    openssl \
    # Archive tools
    zip \
    unzip \
    tar \
    gzip \
    bzip2 \
    xz-utils \
    p7zip-full \
    # JSON/YAML tools
    jq \
    yq \
    # Database clients
    mysql-client \
    postgresql-client \
    sqlite3 \
    redis-tools \
    # Cloud CLI tools dependencies
    apt-transport-https \
    ca-certificates \
    gnupg \
    lsb-release \
    software-properties-common \
    # Development libraries
    libssl-dev \
    libffi-dev \
    libreadline-dev \
    zlib1g-dev \
    libbz2-dev \
    libsqlite3-dev \
    libncurses5-dev \
    libncursesw5-dev \
    libxml2-dev \
    libxslt1-dev \
    libyaml-dev \
    libcurl4-openssl-dev \
    libpq-dev \
    libmysqlclient-dev \
    # System utilities
    htop \
    tree \
    less \
    file \
    bc \
    man-db \
    locales \
    sudo \
    lsof \
    rsync \
    patch \
    diffutils \
    findutils \
    coreutils \
    procps \
    psmisc \
    # Text processing
    sed \
    gawk \
    grep \
    ripgrep \
    fd-find \
    silversearcher-ag \
    fzf \
    && rm -rf /var/lib/apt/lists/*

# Install Docker via official script
RUN curl -fsSL https://get.docker.com | sh

# Set up locales
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# Install Node.js LTS (v20.x) and npm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

# Install Playwright browser dependencies and browsers
RUN npx playwright install-deps && \
    npx playwright install

# Install Rust via rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Install uv (fast Python package installer)
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
ENV PATH="/root/.local/bin:${PATH}"

# Install additional Python packages
RUN pip3 install --break-system-packages --ignore-installed \
    pipenv \
    poetry \
    virtualenv \
    black \
    flake8 \
    pylint \
    pytest \
    mypy \
    ipython \
    jupyter \
    requests \
    numpy \
    pandas

# Install Node.js global packages
RUN npm install -g \
    yarn \
    pnpm \
    typescript \
    ts-node \
    eslint \
    prettier \
    nodemon \
    pm2 \
    serve \
    http-server \
    playwright

# Install Google Chrome
RUN curl -fsSL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/chrome.deb && \
    apt-get update && \
    apt-get install -y /tmp/chrome.deb && \
    rm /tmp/chrome.deb && \
    rm -rf /var/lib/apt/lists/*

# Create a non-root user for development
RUN useradd -m -s /bin/bash claude && \
    echo "claude ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
    usermod -aG docker claude && \
    mkdir -p /home/claude/.local/bin && \
    chown -R claude:claude /home/claude

# Install claude-code as claude user
USER claude
RUN curl -fsSL https://claude.ai/install.sh | bash && \
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
USER root

# Set up Git configuration
RUN git config --global init.defaultBranch main

# Set working directory
WORKDIR /home/claude

# Expose common development ports
EXPOSE 3000 5000 8000 8080 9000

# Default command
CMD ["/sbin/init"]