-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContainerfile.base
More file actions
73 lines (63 loc) · 2.49 KB
/
Copy pathContainerfile.base
File metadata and controls
73 lines (63 loc) · 2.49 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
# Containerfile.base — Multi-arch base image for OpenCode Dev
#
# Foundation layer: Fedora 41 + system packages + Go 1.25 + non-root user.
# Does NOT include UF tools (uf, dewey, replicator, gaze), OpenCode,
# OpenSpec CLI, or any project-specific scripts.
#
# Published to: quay.io/unbound-force/opencode-base:latest
# Rebuilt: weekly via scheduled CI + manual dispatch
#
# The primary Containerfile uses this as its FROM to skip the slow
# dnf + Go download steps on every build.
#
# Build:
# podman build -t opencode-base -f Containerfile.base .
#
# Smoke test:
# podman run --rm --entrypoint whoami opencode-base # prints "dev"
# podman run --rm --entrypoint go opencode-base version
FROM registry.fedoraproject.org/fedora:41
# ---------------------------------------------------------------------------
# System packages (as root)
# ---------------------------------------------------------------------------
RUN dnf install -y \
nodejs \
npm \
git \
gh \
curl \
findutils \
procps-ng \
which \
tar \
gzip \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# ---------------------------------------------------------------------------
# Go from official tarball (Fedora 41 ships 1.24; dewey needs 1.25+)
# ---------------------------------------------------------------------------
ARG GO_VERSION=1.25.3
RUN ARCH="$(uname -m)" \
&& case "$ARCH" in \
x86_64) GOARCH=amd64 ;; \
aarch64) GOARCH=arm64 ;; \
*) echo "Unsupported arch: $ARCH" && exit 1 ;; \
esac \
&& curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz" \
| tar -C /usr/local -xz \
&& ln -s /usr/local/go/bin/go /usr/local/bin/go \
&& ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
# ---------------------------------------------------------------------------
# Non-root user
# ---------------------------------------------------------------------------
RUN useradd -m -s /bin/bash dev
# ---------------------------------------------------------------------------
# Environment — inherited by all downstream images
# ---------------------------------------------------------------------------
ENV GOROOT=/usr/local/go \
GOPATH=/home/dev/go \
NPM_CONFIG_PREFIX=/home/dev/.npm-global \
PATH="/usr/local/go/bin:/home/dev/go/bin:/home/dev/.npm-global/bin:/home/dev/.opencode/bin:/home/dev/.local/bin:$PATH" \
DEWEY_EMBEDDING_ENDPOINT=http://host.containers.internal:11434
USER dev
WORKDIR /home/dev