Skip to content

Commit f2aa759

Browse files
akurinnoyclaude
andcommitted
feat: agent-base image with ttyd and tmux
Dockerfile and CI for an agent-base container image built on UDI (Universal Developer Image). Includes ttyd for web terminal access and pre-built tmux with multi-arch support (x86_64/arm64). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
1 parent b0ba905 commit f2aa759

3 files changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build image (PR validation)
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
env:
8+
IMAGE: quay.io/akurinnoy/agent-base
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Log in to Quay.io
23+
uses: docker/login-action@v3
24+
with:
25+
registry: quay.io
26+
username: ${{ secrets.QUAY_USERNAME }}
27+
password: ${{ secrets.QUAY_PASSWORD }}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
platforms: linux/amd64,linux/arm64
34+
push: true
35+
tags: ${{ env.IMAGE }}:pr-${{ github.event.pull_request.number }}
36+
37+
- name: Set tag expiration (14 days)
38+
run: |
39+
EXPIRATION=$(date -u -d '+14 days' +%s)
40+
curl -s -X PUT \
41+
-u "${{ secrets.QUAY_USERNAME }}:${{ secrets.QUAY_PASSWORD }}" \
42+
-H "Content-Type: application/json" \
43+
-d "{\"expiration\": ${EXPIRATION}}" \
44+
"https://quay.io/api/v1/repository/akurinnoy/agent-base/tag/pr-${{ github.event.pull_request.number }}"

.github/workflows/build-image.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and push multi-arch image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
env:
9+
IMAGE: quay.io/akurinnoy/agent-base
10+
TAG: latest
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Log in to Quay.io
25+
uses: docker/login-action@v3
26+
with:
27+
registry: quay.io
28+
username: ${{ secrets.QUAY_USERNAME }}
29+
password: ${{ secrets.QUAY_PASSWORD }}
30+
31+
- name: Build and push
32+
uses: docker/build-push-action@v6
33+
with:
34+
context: .
35+
platforms: linux/amd64,linux/arm64
36+
push: true
37+
tags: ${{ env.IMAGE }}:${{ env.TAG }}

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM docker.io/tsl0922/ttyd:1.7.8-alpine AS ttyd
2+
3+
FROM quay.io/devfile/universal-developer-image:ubi9-latest
4+
5+
ARG TARGETARCH
6+
ARG TMUX_VERSION=3.6a
7+
8+
RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "arm64" ;; *) echo "${TARGETARCH}" ;; esac) && \
9+
curl -fsSL "https://github.com/tmux/tmux-builds/releases/download/v${TMUX_VERSION}/tmux-${TMUX_VERSION}-linux-${ARCH}.tar.gz" \
10+
| tar xz -C /usr/bin tmux
11+
12+
COPY --from=ttyd /usr/bin/ttyd /usr/bin/ttyd
13+
14+
EXPOSE 7681
15+
CMD ["/usr/bin/ttyd", "-W", "-p", "7681", "bash"]

0 commit comments

Comments
 (0)