-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathContainerfile
More file actions
105 lines (93 loc) · 3.44 KB
/
Copy pathContainerfile
File metadata and controls
105 lines (93 loc) · 3.44 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
#
# 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:be840bb76e74900d39d5e4620c184e89382dcfce09cb05c98b4e1246d55612a5 as preparer
ARG TARGETARCH
RUN dnf install -y git && \
dnf clean all
# GCloud
ENV GCLOUD_V 575.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 echo "cs-cache-key: ${CS_CACHE_KEY}" \
&& set -eux; \
if [ "${CS_REF_TYPE}" = "pr" ]; then \
git clone "${CS_REPO}"; \
git -C claudio-skills fetch --depth 1 origin "pull/${CS_REF}/head"; \
git -C claudio-skills checkout FETCH_HEAD; \
fi; \
mkdir -p claudio-skills;
# Claudio image
FROM registry.access.redhat.com/ubi10/python-312-minimal@sha256:fd68b7fc2cb62fa2b78956772fc5acdd8bbcb4589c88b608f4b80fcf4e0c9262
ARG TARGETARCH
USER root
ENV HOME /home/claudio
ENV PATH="${HOME}/.local/bin:${PATH}"
# Base for claudio image
RUN microdnf install -y skopeo podman unzip gzip git jq && \
microdnf clean all && \
useradd claudio
# Claude
# https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
ENV CLAUDE_V 2.1.197
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}"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -fsSL https://claude.ai/install.sh | bash -s ${CLAUDE_V}
# 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/ entrypoint.sh /usr/local/bin/
# Claudio Skills
COPY --from=preparer /claudio-skills /home/claudio/claudio-skills
ARG CS_REF_TYPE
ARG CS_REF
ARG CS_CACHE_KEY
RUN echo "cs-cache-key: ${CS_CACHE_KEY}" \
&& if [ "${CS_REF_TYPE}" = "pr" ]; then \
claude plugin marketplace add /home/claudio/claudio-skills; \
else \
claude plugin marketplace add aipcc-cicd/claudio-skills@${CS_REF}; \
fi; \
claude plugin install --scope user claudio-plugin; \
pt-manager.sh
# Claudio
RUN chown -R claudio:0 ${HOME}; \
chmod -R ug+rwx ${HOME}
USER claudio
WORKDIR /home/claudio
# Entrypoint
ENTRYPOINT ["entrypoint.sh"]