-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
175 lines (159 loc) · 5.65 KB
/
Dockerfile
File metadata and controls
175 lines (159 loc) · 5.65 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
FROM --platform=$BUILDPLATFORM golang:1.26.1 AS guestd-builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./
COPY packages/guestd ./packages/guestd
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -o /out/microagent-guestd ./packages/guestd/cmd/guestd
FROM public.ecr.aws/docker/library/ubuntu:24.04
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8 \
EDITOR=nvim \
VISUAL=nvim \
XDG_CONFIG_HOME=/home/node/.config \
XDG_CACHE_HOME=/home/node/.cache \
XDG_DATA_HOME=/home/node/.local/share \
XDG_STATE_HOME=/home/node/.local/state
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
software-properties-common \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& printf '%s\n' "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list \
&& add-apt-repository -y ppa:neovim-ppa/unstable \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bat \
build-essential \
dbus-x11 \
dnsutils \
eza \
fd-find \
file \
fonts-dejavu-core \
fzf \
gh \
git \
htop \
iputils-ping \
iproute2 \
jitterentropy-rngd \
jq \
just \
less \
lsof \
make \
man-db \
manpages \
netcat-openbsd \
net-tools \
ncurses-bin \
neovim \
nodejs \
novnc \
openssh-server \
pipx \
procps \
python3 \
python3-pip \
python3-venv \
ripgrep \
rsync \
shellcheck \
sqlite3 \
sudo \
tmux \
tree \
unzip \
wget \
xz-utils \
zsh \
zsh-autosuggestions \
zsh-syntax-highlighting \
websockify \
x11-utils \
x11-xserver-utils \
x11vnc \
xauth \
xvfb \
xfce4-session \
xfwm4 \
xfdesktop4 \
xfce4-settings \
xfce4-terminal \
xfconf \
thunar \
plank \
e2fsprogs \
autocutsel \
greybird-gtk-theme \
elementary-xfce-icon-theme \
fonts-noto-core \
fonts-noto-color-emoji \
dbus-user-session \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /tmp/google-chrome-stable.deb \
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get update -qq \
&& apt-get install -y --no-install-recommends /tmp/google-chrome-stable.deb \
&& rm -f /tmp/google-chrome-stable.deb /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/share/fonts/truetype/jetbrains-mono \
&& curl -fsSL -o /tmp/jbmono.tar.xz \
https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.tar.xz \
&& tar xf /tmp/jbmono.tar.xz -C /usr/share/fonts/truetype/jetbrains-mono \
&& fc-cache -f \
&& rm -f /tmp/jbmono.tar.xz
RUN useradd --create-home --shell /bin/bash node \
&& passwd -d node \
&& mkdir -p /home/node/.ssh \
&& chown -R node:node /home/node \
&& usermod -aG sudo node \
&& printf 'node ALL=(ALL) NOPASSWD:ALL\n' >/etc/sudoers.d/node \
&& chmod 440 /etc/sudoers.d/node \
&& install -d -m 0755 /etc/microagent \
&& install -d -m 0755 -o node -g node /home/node/.local \
&& install -d -m 0755 -o node -g node /home/node/.local/bin \
&& install -d -m 0755 -o node -g node /home/node/.local/share \
&& install -d -m 0755 -o node -g node /home/node/.local/state \
&& ln -sf /usr/bin/fdfind /usr/local/bin/fd \
&& ln -sf /usr/bin/batcat /usr/local/bin/bat \
&& ln -sf /usr/bin/nvim /usr/local/bin/vim \
&& ln -sf /usr/bin/nvim /usr/local/bin/vi
COPY desktop/assets /opt/desktop/assets
COPY desktop/xfce /opt/desktop/xfce
COPY desktop/plank /opt/desktop/plank
COPY desktop/scripts /opt/desktop/scripts
COPY sshd_config /etc/ssh/sshd_config
COPY microagent-init.sh /usr/local/bin/microagent-init
COPY microagent-desktop-session.sh /usr/local/bin/microagent-desktop-session
COPY microagent-network-up.sh /usr/local/bin/microagent-network-up
COPY microagent-ready-agent.py /usr/local/bin/microagent-ready-agent
COPY --from=guestd-builder /out/microagent-guestd /usr/local/bin/microagent-guestd
COPY defaults/.zshrc /home/node/.zshrc
COPY defaults/.bashrc /home/node/.bashrc
COPY defaults/.profile /home/node/.profile
COPY defaults/pip.conf /etc/pip.conf
COPY defaults/AGENTS.md /home/node/AGENTS.md
COPY terminfo/xterm-ghostty.terminfo /tmp/xterm-ghostty.terminfo
COPY terminfo/xterm-kitty.terminfo /tmp/xterm-kitty.terminfo
RUN chmod 755 /usr/local/bin/microagent-init /usr/local/bin/microagent-desktop-session /usr/local/bin/microagent-network-up /usr/local/bin/microagent-ready-agent /usr/local/bin/microagent-guestd \
&& chmod 755 /opt/desktop/scripts/apply-desktop-profile.sh \
&& chown node:node /home/node/.zshrc /home/node/.bashrc /home/node/.profile /home/node/AGENTS.md \
&& ln -sf /home/node/AGENTS.md /home/node/CLAUDE.md \
&& usermod -s /usr/bin/zsh node \
&& install -d /opt/zsh/pure \
&& ln -sf /usr/local/bin/microagent-init /sbin/init \
&& curl -fsSL https://raw.githubusercontent.com/sindresorhus/pure/v1.27.0/pure.zsh -o /opt/zsh/pure/pure.zsh \
&& curl -fsSL https://raw.githubusercontent.com/sindresorhus/pure/v1.27.0/async.zsh -o /opt/zsh/pure/async.zsh \
&& tic -x -o /usr/share/terminfo /tmp/xterm-ghostty.terminfo \
&& tic -x -o /usr/share/terminfo /tmp/xterm-kitty.terminfo \
&& rm -f /tmp/xterm-ghostty.terminfo /tmp/xterm-kitty.terminfo
RUN npm install -g \
@anthropic-ai/claude-code \
@openai/codex \
&& npm cache clean --force
CMD ["/usr/local/bin/microagent-init"]