forked from aipcc-cicd/claudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
109 lines (94 loc) · 3.49 KB
/
Copy pathContainerfile
File metadata and controls
109 lines (94 loc) · 3.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
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
106
107
108
109
#
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
FROM registry.access.redhat.com/ubi10@sha256:37d90a02d14afed06b6fff1ed0a33cd07b96187e90ed46d8871fdce550538b43 as preparer
ARG TARGETARCH
RUN dnf install -y git
# GCloud
ENV GCLOUD_V 565.0.0
ENV GCLOUD_BASE_URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${GCLOUD_V}"
ENV GCLOUD_URL="${GCLOUD_BASE_URL}-linux-x86_64.tar.gz"
RUN set -eux; \
if [ "$TARGETARCH" = "arm64" ]; then \
export GCLOUD_URL="${GCLOUD_BASE_URL}-linux-arm.tar.gz"; \
fi; \
curl -L "$GCLOUD_URL" -o gcloud.tar.gz; \
tar -xzf gcloud.tar.gz -C /opt;
# Claudio Skills
ARG CS_REF_TYPE
ARG CS_REF
# CS_CACHE_KEY is the resolved commit SHA — changing it invalidates the layer
# cache so we always get fresh content when the remote ref updates.
ARG CS_CACHE_KEY
ENV CS_REPO https://github.com/aipcc-cicd/claudio-skills.git
RUN set -eux; \
git init claudio-skills; \
cd claudio-skills; \
git remote add origin "${CS_REPO}"; \
if [ "${CS_REF_TYPE}" = "pr" ]; then \
git fetch --depth 1 origin "pull/${CS_REF}/head"; \
else \
git fetch --depth 1 origin "${CS_REF}"; \
fi; \
git checkout FETCH_HEAD;
# Claudio image
FROM registry.access.redhat.com/ubi10/python-312-minimal@sha256:7350725154e3419463f815c5faae915de4dbf191cd4c3183dbc080ac6d1d5e0c
ARG TARGETARCH
USER root
ENV HOME /home/claudio
# Base for claudio image
RUN microdnf install -y skopeo podman unzip gzip git; \
useradd claudio
# Claude
# https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
ENV CLAUDE_V 2.1.118
ENV CLAUDE_CODE_USE_VERTEX=1 \
CLOUD_ML_REGION=global \
ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5@20251001 \
DISABLE_AUTOUPDATER=1
ENV CLAUDE_BASE_URL="https://github.com/anthropics/claude-code/releases/download/v${CLAUDE_V}/claude-code-v${CLAUDE_V}"
RUN curl -fsSL https://claude.ai/install.sh | bash -s ${CLAUDE_V} && \
ln -s ~/.local/bin/claude /usr/local/bin/claude
# GCloud
COPY --from=preparer /opt/google-cloud-sdk /opt/google-cloud-sdk
RUN set -eux; \
/opt/google-cloud-sdk/install.sh -q; \
ln -s /opt/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud;
# Conf
COPY conf/ ${HOME}/
COPY scripts/ /usr/local/bin/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# Skills
COPY --from=preparer /claudio-skills /home/claudio/claudio-skills
RUN set -eux; \
for script in "${HOME}/claudio-skills"/claudio-plugin/tools/*/install.sh; do \
[ -f "$script" ] && bash "$script"; \
done; \
\
for req in "${HOME}/claudio-skills"/claudio-plugin/tools/python/*-requirements.txt; do \
[ -f "$req" ] && pip install --no-cache-dir -r "$req"; \
done; \
\
/usr/local/bin/generate-plugin-configs.sh \
"${HOME}/claudio-skills" \
"${HOME}/.claude/plugins"
# Claudio
RUN chown -R claudio:0 ${HOME}; \
chmod -R ug+rwx ${HOME}
USER claudio
WORKDIR /home/claudio
# Entrypoint
ENTRYPOINT ["entrypoint.sh"]