Skip to content

Commit b0ef0c1

Browse files
committed
Add image
1 parent 5d69b13 commit b0ef0c1

File tree

3 files changed

+254
-0
lines changed

3 files changed

+254
-0
lines changed

.github/workflows/build-image.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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

Dockerfile

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

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
# codex-universal
22
Base docker image used in Codex environments
3+
4+
# Usage
5+
6+
```
7+
docker pull ghcr.io/openai/codex-universal:latest
8+
```
9+
10+
```
11+
docker run -v $(pwd):/workspace/$(basename $(pwd)) -it ghcr.io/openai/codex-universal:latest
12+
```

0 commit comments

Comments
 (0)