Skip to content

Commit f426fb1

Browse files
committed
Initial commit
0 parents  commit f426fb1

File tree

9 files changed

+1560
-0
lines changed

9 files changed

+1560
-0
lines changed

.github/workflows/build-image.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build image
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
attestations: write
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Log in to ghcr.io
22+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
- name: Build and push
30+
uses: docker/build-push-action@v6
31+
with:
32+
push: true
33+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
34+
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:cache
35+
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:cache,mode=max

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Dockerfile

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
FROM ubuntu:24.04
2+
3+
ENV LANG="C.UTF-8"
4+
ENV HOME=/root
5+
6+
### BASE ###
7+
8+
RUN apt-get update \
9+
&& apt-get upgrade -y \
10+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
11+
binutils \
12+
sudo \
13+
build-essential \
14+
bzr \
15+
curl \
16+
default-libmysqlclient-dev \
17+
dnsutils \
18+
gettext \
19+
git \
20+
git-lfs \
21+
gnupg2 \
22+
inotify-tools \
23+
iputils-ping \
24+
jq \
25+
libbz2-dev \
26+
libc6 \
27+
libc6-dev \
28+
libcurl4-openssl-dev \
29+
libdb-dev \
30+
libedit2 \
31+
libffi-dev \
32+
libgcc-13-dev \
33+
libgcc1 \
34+
libgdbm-compat-dev \
35+
libgdbm-dev \
36+
libgdiplus \
37+
libgssapi-krb5-2 \
38+
liblzma-dev \
39+
libncurses-dev \
40+
libncursesw5-dev \
41+
libnss3-dev \
42+
libpq-dev \
43+
libpsl-dev \
44+
libpython3-dev \
45+
libreadline-dev \
46+
libsqlite3-dev \
47+
libssl-dev \
48+
libstdc++-13-dev \
49+
libunwind8 \
50+
libuuid1 \
51+
libxml2-dev \
52+
libz3-dev \
53+
make \
54+
moreutils \
55+
netcat-openbsd \
56+
openssh-client \
57+
pkg-config \
58+
protobuf-compiler \
59+
python3-pip \
60+
ripgrep \
61+
rsync \
62+
software-properties-common \
63+
sqlite3 \
64+
swig3.0 \
65+
tk-dev \
66+
tzdata \
67+
unixodbc-dev \
68+
unzip \
69+
uuid-dev \
70+
xz-utils \
71+
zip \
72+
zlib1g \
73+
zlib1g-dev \
74+
&& rm -rf /var/lib/apt/lists/*
75+
76+
### PYTHON ###
77+
78+
ARG PYENV_VERSION=v2.5.5
79+
ARG PYTHON_VERSION=3.11.12
80+
81+
# Install pyenv
82+
ENV PYENV_ROOT=/root/.pyenv
83+
ENV PATH=$PYENV_ROOT/bin:$PATH
84+
RUN git -c advice.detachedHead=0 clone --branch ${PYENV_VERSION} --depth 1 https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" \
85+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> /etc/profile \
86+
&& echo 'export PATH="$$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"' >> /etc/profile \
87+
&& echo 'eval "$(pyenv init - bash)"' >> /etc/profile \
88+
&& cd ${PYENV_ROOT} && src/configure && make -C src \
89+
&& pyenv install 3.10 3.11.12 3.12 3.13 \
90+
&& pyenv global ${PYTHON_VERSION}
91+
# Install pipx for common global package managers (e.g. poetry)
92+
ENV PIPX_BIN_DIR=/root/.local/bin
93+
ENV PATH=$PIPX_BIN_DIR:$PATH
94+
RUN apt-get update && apt-get install -y pipx \
95+
&& pipx install poetry uv \
96+
# Preinstall common packages for each version
97+
&& for pyv in $(ls ${PYENV_ROOT}/versions/); do \
98+
${PYENV_ROOT}/versions/$pyv/bin/pip install --upgrade pip ruff black mypy pyright isort; \
99+
done
100+
101+
102+
### NODE ###
103+
104+
ARG NVM_VERSION=v0.40.2
105+
ARG NODE_VERSION=22
106+
107+
ENV NVM_DIR=/root/.nvm
108+
# Corepack tries to do too much - disable some of its features:
109+
# https://github.com/nodejs/corepack/blob/main/README.md
110+
ENV COREPACK_DEFAULT_TO_LATEST=0
111+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
112+
ENV COREPACK_ENABLE_AUTO_PIN=0
113+
ENV COREPACK_ENABLE_STRICT=0
114+
RUN git -c advice.detachedHead=0 clone --branch ${NVM_VERSION} --depth 1 https://github.com/nvm-sh/nvm.git "${NVM_DIR}" \
115+
&& echo 'source $NVM_DIR/nvm.sh' >> /etc/profile \
116+
&& echo "prettier\neslint\ntypescript" > $NVM_DIR/default-packages \
117+
&& . $NVM_DIR/nvm.sh \
118+
&& nvm install 18 \
119+
&& nvm install 20 \
120+
&& nvm install 22 \
121+
&& nvm alias default $NODE_VERSION \
122+
&& corepack enable \
123+
&& corepack install -g yarn pnpm npm
124+
125+
### BUN ###
126+
127+
ARG BUN_VERSION=1.2.10
128+
129+
ENV BUN_INSTALL=/root/.bun
130+
ENV PATH="$BUN_INSTALL/bin:$PATH"
131+
132+
RUN mkdir -p "$BUN_INSTALL/bin" \
133+
&& curl -L --fail "https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-x64-baseline.zip" \
134+
-o /tmp/bun.zip \
135+
&& unzip -q /tmp/bun.zip -d "$BUN_INSTALL/bin" \
136+
&& mv "$BUN_INSTALL/bin/bun-linux-x64-baseline/bun" "$BUN_INSTALL/bin/bun" \
137+
&& chmod +x "$BUN_INSTALL/bin/bun" \
138+
&& rm -rf "$BUN_INSTALL/bin/bun-linux-x64-baseline" /tmp/bun.zip \
139+
&& echo 'export BUN_INSTALL=/root/.bun' >> /etc/profile \
140+
&& echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile
141+
142+
### JAVA ###
143+
144+
ARG JAVA_VERSION=21
145+
ARG GRADLE_VERSION=8.14
146+
ARG GRADLE_DOWNLOAD_SHA256=61ad310d3c7d3e5da131b76bbf22b5a4c0786e9d892dae8c1658d4b484de3caa
147+
148+
ENV GRADLE_HOME=/opt/gradle
149+
RUN apt-get update && apt-get install -y --no-install-recommends \
150+
openjdk-${JAVA_VERSION}-jdk \
151+
&& rm -rf /var/lib/apt/lists/* \
152+
&& curl -LO "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \
153+
&& echo "${GRADLE_DOWNLOAD_SHA256} *gradle-${GRADLE_VERSION}-bin.zip" | sha256sum --check - \
154+
&& unzip gradle-${GRADLE_VERSION}-bin.zip \
155+
&& rm gradle-${GRADLE_VERSION}-bin.zip \
156+
&& mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \
157+
&& ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle
158+
159+
### SWIFT ###
160+
161+
ARG SWIFT_VERSION=6.1
162+
163+
# Install swift.
164+
RUN mkdir /tmp/swiftly \
165+
&& cd /tmp/swiftly \
166+
&& curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz \
167+
&& tar zxf swiftly-$(uname -m).tar.gz \
168+
&& ./swiftly init --quiet-shell-followup -y \
169+
&& echo '. ~/.local/share/swiftly/env.sh' >> /etc/profile \
170+
&& bash -lc "swiftly install --use ${SWIFT_VERSION}" \
171+
&& rm -rf /tmp/swiftly
172+
173+
### RUBY ###
174+
175+
RUN apt-get update && apt-get install -y --no-install-recommends \
176+
ruby-full
177+
178+
### RUST ###
179+
180+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
181+
sh -s -- -y --profile minimal \
182+
&& . "$HOME/.cargo/env" \
183+
&& rustup show
184+
185+
### GO ###
186+
187+
ARG GO_VERSION=1.23.8
188+
ARG GO_DOWNLOAD_SHA256=45b87381172a58d62c977f27c4683c8681ef36580abecd14fd124d24ca306d3f
189+
190+
# Go defaults GOROOT to /usr/local/go - we just need to update PATH
191+
ENV PATH=/usr/local/go/bin:$HOME/go/bin:$PATH
192+
RUN mkdir /tmp/go \
193+
&& cd /tmp/go \
194+
&& curl -O https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz \
195+
&& echo "${GO_DOWNLOAD_SHA256} *go${GO_VERSION}.linux-amd64.tar.gz" | sha256sum --check - \
196+
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
197+
&& rm -rf /tmp/go
198+
199+
### BAZEL ###
200+
201+
RUN curl -L --fail https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
202+
&& chmod +x /usr/local/bin/bazelisk \
203+
&& ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel
204+
205+
### LLVM ###
206+
RUN apt-get update && apt-get install -y --no-install-recommends \
207+
git \
208+
cmake \
209+
ccache \
210+
python3 \
211+
ninja-build \
212+
nasm \
213+
yasm \
214+
gawk \
215+
lsb-release \
216+
wget \
217+
software-properties-common \
218+
gnupg \
219+
&& rm -rf /var/lib/apt/lists/* \
220+
&& bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
221+
222+
### SETUP SCRIPTS ###
223+
224+
COPY setup_universal.sh /opt/codex/setup_universal.sh
225+
RUN chmod +x /opt/codex/setup_universal.sh
226+
227+
COPY entrypoint.sh /opt/entrypoint.sh
228+
RUN chmod +x /opt/entrypoint.sh
229+
230+
ENTRYPOINT ["/opt/entrypoint.sh"]

LICENSES/LICENSE

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
codex-universal is licensed under an MIT License
2+
3+
Copyright (c) 2025 OpenAI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
24+
The Docker image incorporates a variety of open source components, including but not limited to:
25+
26+
- Base system: Ubuntu 24.04
27+
- Languages: Python, Node.js, Ruby, Go, Rust, Java (OpenJDK), Swift
28+
- Developer tools: Poetry, Bun, Gradle, LLVM, pipx, pyenv, and others
29+
30+
These components are governed by licenses such as:
31+
- MIT, Apache-2.0, BSD, Python-2.0 (permissive)
32+
- GPL-2.0, GPL-2.0 with Classpath Exception, Artistic-2.0 (copyleft)
33+
34+
We use these components in accordance with their licenses and do not statically link GPL-covered libraries with proprietary software.
35+
36+
Software Bill of Materials (SBOM)
37+
38+
To support transparency and license compliance, we provide the following SBOMs:
39+
40+
- codex-universal-image-sbom.md : Human-readable list of components and licenses
41+
- codex-universal-image-sbom.spdx.json : SPDX-compliant JSON
42+
43+
Source Code for Open Source Components
44+
45+
You can obtain source code for components from their respective upstream sources:
46+
47+
- Ubuntu: https://packages.ubuntu.com/
48+
- PyPI: https://pypi.org/
49+
- npm: https://www.npmjs.com/
50+
- GitHub (for tools like pyenv, nvm, bun, bazelisk)

0 commit comments

Comments
 (0)