mirror of
https://github.com/truecharts/charts.git
synced 2026-07-07 01:41:20 -03:00
**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made changes to the documentation - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning - [ ] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com>
90 lines
3.6 KiB
Docker
90 lines
3.6 KiB
Docker
# hadolint ignore=DL3007
|
|
FROM mcr.microsoft.com/devcontainers/base:alpine
|
|
|
|
ARG CLUSTERTOOL_VERSION=2.0.0
|
|
ARG CONTAINER_NAME
|
|
|
|
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
|
|
RUN apk update && \
|
|
apk --no-cache add \
|
|
age bash bind-tools ca-certificates curl direnv fish fzf \
|
|
gettext git github-cli helm iputils jq k9s kubectl kustomize \
|
|
python3 py3-pip moreutils openssh-client openssl starship yq \
|
|
sshfs libc6-compat fuse && \
|
|
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
|
|
|
# Install CLI tools via jpillora scripts
|
|
RUN for app in \
|
|
"budimanjojo/talhelper!!?as=talhelper&type=script" \
|
|
"fluxcd/flux2!!?as=flux&type=script" \
|
|
"helmfile/helmfile!!?as=helmfile&type=script" \
|
|
"kubecolor/kubecolor!!?as=kubecolor&type=script" \
|
|
"kubernetes-sigs/krew!!?as=krew&type=script" \
|
|
"siderolabs/talos!!?as=talosctl&type=script"; \
|
|
do \
|
|
echo "=== Installing ${app} ==="; \
|
|
curl -fsSL "https://i.jpillora.com/${app}" | bash; \
|
|
done
|
|
|
|
# Create the completions and conf.d directories explicitly
|
|
RUN mkdir -p /home/vscode/.config/fish/completions && \
|
|
mkdir -p /home/vscode/.config/fish/conf.d
|
|
|
|
# Add completions only if the command exists
|
|
RUN for tool in cilium flux helm helmfile k9s kubectl kustomize talhelper talosctl; do \
|
|
if command -v "$tool" >/dev/null 2>&1; then \
|
|
mkdir -p /home/vscode/.config/fish/completions && \
|
|
$tool completion fish > "/home/vscode/.config/fish/completions/${tool}.fish" || true; \
|
|
fi; \
|
|
done && \
|
|
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish || true && \
|
|
stern --completion fish > /home/vscode/.config/fish/completions/stern.fish || true && \
|
|
yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish || true
|
|
|
|
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
|
|
printf '%s\n' \
|
|
"if status is-interactive" \
|
|
" direnv hook fish | source" \
|
|
" starship init fish | source" \
|
|
"end" \
|
|
> /home/vscode/.config/fish/conf.d/hooks.fish
|
|
|
|
# Add aliases to fish config
|
|
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
|
|
printf '%s\n' \
|
|
"alias kubectl kubecolor" \
|
|
"alias k kubectl" \
|
|
> /home/vscode/.config/fish/conf.d/aliases.fish
|
|
|
|
# Custom fish prompt
|
|
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
|
|
echo "set fish_greeting" > /home/vscode/.config/fish/conf.d/fish_greeting.fish
|
|
|
|
# Setup direnv whitelist
|
|
RUN mkdir -p /home/vscode/.config/direnv && \
|
|
tee /home/vscode/.config/direnv/direnv.toml > /dev/null <<EOF
|
|
[whitelist]
|
|
prefix = [ "/workspaces" ]
|
|
EOF
|
|
|
|
# Fix permissions for devcontainer user
|
|
RUN chown -R vscode:vscode /home/vscode/
|
|
RUN chmod -R 755 /home/vscode/
|
|
|
|
# Download and set up the clustertool binary
|
|
RUN curl -L "https://github.com/truecharts/public/releases/download/v${CLUSTERTOOL_VERSION}/clustertool_${CLUSTERTOOL_VERSION}_linux_amd64.tar.gz" -o /tmp/clustertool.tar.gz \
|
|
&& tar -xzvf /tmp/clustertool.tar.gz -C /usr/local/bin \
|
|
&& chmod +x /usr/local/bin/clustertool \
|
|
&& rm /tmp/clustertool.tar.gz
|
|
|
|
# Maintainer and metadata
|
|
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
|
|
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
|
|
LABEL org.opencontainers.image.licenses="All-Rights-Reserved"
|
|
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
|
|
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
|
|
LABEL org.opencontainers.image.version="${CLUSTERTOOL_VERSION}"
|
|
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
|
|
LABEL org.opencontainers.image.authors="TrueCharts"
|
|
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
|