forked from langchain-ai/open-swe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
105 lines (91 loc) · 4.18 KB
/
Copy pathDockerfile
File metadata and controls
105 lines (91 loc) · 4.18 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
FROM python:3.14.6-slim-trixie
ARG DOCKER_CLI_VERSION=5:29.1.5-1~debian.13~trixie
ARG NODEJS_VERSION=22.22.0-1nodesource1
ARG UV_VERSION=0.9.26
ARG YARN_VERSION=4.12.0
ARG GH_VERSION=2.83.1
ARG SFW_VERSION=2.0.6
ENV DEBIAN_FRONTEND=noninteractive
# Skip sfw's daily background update check at runtime. The check hits
# api.github.com/repos/SocketDev/sfw-free, which the sandbox proxy authenticates
# with the GitHub App installation token (no access to that repo), so it fails
# and the wrapper can't fall back to a binary it never managed to fetch. The
# initial download still runs at build time below, where egress is unrestricted.
ENV SFW_SKIP_UPDATE_CHECK=1
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
ca-certificates \
gnupg \
lsb-release \
build-essential \
openssh-client \
jq \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" \
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y "docker-ce-cli=${DOCKER_CLI_VERSION}" \
&& rm -rf /var/lib/apt/lists/*
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
amd64) gh_arch="amd64" ;; \
arm64) gh_arch="arm64" ;; \
*) echo "unsupported architecture: ${arch}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${gh_arch}.deb" -o /tmp/gh.deb; \
apt-get update; \
apt-get install -y /tmp/gh.deb; \
rm -rf /tmp/gh.deb /var/lib/apt/lists/*
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
amd64) uv_arch="x86_64-unknown-linux-gnu"; uv_sha256="30ccbf0a66dc8727a02b0e245c583ee970bdafecf3a443c1686e1b30ec4939e8" ;; \
arm64) uv_arch="aarch64-unknown-linux-gnu"; uv_sha256="f71040c59798f79c44c08a7a1c1af7de95a8d334ea924b47b67ad6b9632be270" ;; \
*) echo "unsupported architecture: ${arch}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${uv_arch}.tar.gz" -o /tmp/uv.tar.gz; \
echo "${uv_sha256} /tmp/uv.tar.gz" | sha256sum -c -; \
tar -xzf /tmp/uv.tar.gz -C /tmp; \
install -m 0755 -d /root/.local/bin; \
install -m 0755 "/tmp/uv-${uv_arch}/uv" /root/.local/bin/uv; \
install -m 0755 "/tmp/uv-${uv_arch}/uvx" /root/.local/bin/uvx; \
rm -rf /tmp/uv.tar.gz "/tmp/uv-${uv_arch}"
ENV PATH=/root/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y "nodejs=${NODEJS_VERSION}" \
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable \
&& corepack prepare "yarn@${YARN_VERSION}" --activate \
&& npm i -g "sfw@${SFW_VERSION}" \
&& sfw --version \
&& test -e "$(npm root -g)/sfw/.sfw-cache/latest"
# Chromium for Stagehand LOCAL browser mode (STAGEHAND_ENV=LOCAL). Skipped at
# runtime when STAGEHAND_ENV=BROWSERBASE (browser runs on Browserbase cloud).
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium \
&& rm -rf /var/lib/apt/lists/*
ENV STAGEHAND_LOCAL_CHROME_PATH=/usr/bin/chromium
ENV GO_VERSION=1.23.5
RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" | tar -C /usr/local -xz
ENV PATH=/usr/local/go/bin:/root/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV GOPATH=/root/go
ENV PATH=/root/go/bin:/usr/local/go/bin:/root/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORKDIR /workspace
RUN echo "=== Installed versions ===" \
&& python --version \
&& uv --version \
&& node --version \
&& yarn --version \
&& sfw --version \
&& go version \
&& docker --version \
&& git --version \
&& gh --version