Installs the Argo CD CLI (https://argo-cd.readthedocs.io) as a release binary at /usr/local/bin/argocd, verified against the release's cli_checksums.txt. Pin version to your Argo CD server version. The login session lives in ARGOCD_CONFIG_DIR at /var/lib/devcontainer-features/argocd, a named volume the Feature mounts so it survives rebuilds; the argocd-setup post-create hook hands the folder to the remote user.
"features": {
"ghcr.io/nabil-becker/devcontainer-features/argocd:1": {}
}| Options Id | Description | Type | Default Value |
|---|---|---|---|
| installTaskfile | Also install this Feature's Taskfile into /usr/local/share/go-task/includes.d so its tasks appear under the : namespace of a root Taskfile that includes /usr/local/share/go-task/features.yml (see the go-task Feature). | boolean | true |
| version | Argo CD release to install (e.g. '3.5.4', with or without a leading 'v'), or 'latest'. Match your Argo CD server's version. | string | latest |
The argocd CLI binary from github.com/argoproj/argo-cd, at
/usr/local/bin/argocd. install.sh downloads argocd-linux-<arch> and the
release's cli_checksums.txt, checks the binary with sha256sum -c, and
installs it only if the check passes. It runs
argocd version --client --short at the end, so the version is in the build
log. It also installs the argocd-setup post-create hook and the shared
dcf-persist helper on PATH.
versiontakes a number with or without a leadingv(3.5.4,v3.5.4), orlatest(the default).latestis resolved once, at image build time, through thereleases/latestredirect (no API call, no token), so two builds a month apart can differ. Pin it.curlandca-certificatesare installed withapt-getonly whencurlis missing; on an image withoutapt-getthe build fails. Notaris needed (the release asset is the bare binary).- Architectures:
x86_64/amd64andaarch64/arm64. Any otheruname -mfails the build.
version(defaultlatest): change it to the Argo CD server version you talk to; the CLI and the API surface move together. A value that does not start with anx.y.znumber fails the build.installTaskfile(defaulttrue): set it tofalsewhen you do not use the go-task registry and do not want/usr/local/share/go-task/includes.d/argocd.ymlin the image.
There is no run-time override; the version is fixed at build. The state
location is not an option (Feature metadata is static): override it with a
repo mount and containerEnv, see State.
The login session lives under ARGOCD_CONFIG_DIR (the tool's default is
~/.config/argocd; argocd login writes its config file there, with
contexts, servers and users including tokens). The Feature sets
ARGOCD_CONFIG_DIR=/var/lib/devcontainer-features/argocd in containerEnv
and mounts the named volume argocd-config-${devcontainerId} on that
folder, so the session survives rebuilds. Its postCreateCommand hook
argocd-setup (also task argocd:setup; idempotent, never fatal) hands the
folder to the remote user through dcf-persist and reports, in the
post-create log:
argocd: <dir> (<volume|bind|image>, <writable|NOT writable by user>): what backs the folder and whether it is writable.imagemeans nothing is mounted and the session is lost at the next rebuild.argocd-setup: login present (current context: <name>)whenconfigholds a non-emptycontextslist, elseargocd-setup: no login yet (run: argocd login <server>; ...). The file is only scanned; no token is printed and no server is contacted.
A container-engine storage reset or a move to another engine deletes the
volume, and ${devcontainerId} changes when the checkout moves, leaving the
old volume behind.
For the host disk, a repo bind-mounts a host folder on the same target (a
repo's mounts merge after the Features', so its mount wins) and creates it
before the first start:
"initializeCommand": ["task", "devcontainer:homes", "NAME=myrepo", "--", "argocd"],
"mounts": ["source=${localEnv:USERPROFILE}/.devcontainer-homes/myrepo/argocd,target=/var/lib/devcontainer-features/argocd,type=bind"]A repo's own containerEnv wins over the Feature's, which is how it points
ARGOCD_CONFIG_DIR somewhere else entirely.
"features": {
"ghcr.io/nabil-becker/devcontainer-features/argocd:1": {
"version": "3.5.4"
}
}Drop the version line to follow the newest release at each image build.
Log in once afterwards with task argocd:login SERVER=argocd.example.com.
argocd version --client --short # prints the installed client version
task argocd:version
echo "$ARGOCD_CONFIG_DIR" # /var/lib/devcontainer-features/argocd
argocd-setup # path, backing, writable, login stateThe build log carries argocd: downloading Argo CD CLI v<version> (argocd-linux-<arch>)... and the version line; a failed checksum stops the
build with sha256sum's FAILED line. The post-create log carries the two
argocd-setup lines described under State.
installsAfterorders it behind this collection'sgo-taskFeature (so the Taskfile registry exists and is refreshed) and the officialcommon-utils.- Augments no official Feature and replaces none. The shared
dcf-persisthelper it installs is the same file every state-owning Feature of this collection carries. - Independent of
kube-state: the CLI talks to the Argo CD server with its own login and does not useKUBECONFIG. - Pairs with
kustomizeandkubeconformonly in a workflow sense (render and validate manifests that Argo CD then syncs); there is no dependency.
With installTaskfile on, and a root Taskfile that includes the go-task
registry, these appear under argocd:; extra flags go after --.
argocd:version: show client and, when logged in, server versions.argocd:setup: re-runargocd-setup(ownership, backing, login check).argocd:login: log in toSERVER=<host[:port]>(interactive; e.g.-- --sso,-- --grpc-web).argocd:apps: list applications.argocd:diff: show the live-versus-desired diff forAPP=<name>.argocd:sync: syncAPP=<name>now (e.g.-- --prune). This changes the cluster; runargocd:difffirst.
- Linux only, on the two architectures above; others fail with
unsupported architecture. could not resolve an Argo CD version:latestcould not be resolved (no network or no redirect) orversionis not a number. Pin an explicit version or fix the network.- A missing release asset or
cli_checksums.txtline fails the build (curl -f, orsha256sumfinding no matching line). The binary is never installed unchecked. - The session is tied to the volume. The volume is lost on an engine storage
reset or when
${devcontainerId}changes; use the bind mount above to keep it on the host disk. The folder holds tokens: keep it out of any synced checkout. argocd-setupreportsimagewhen no mount backs the folder (for example the repo overrides the mounts away); the login then does not survive.- Tested (
test/argocd): the binary is on PATH, runs and is root-owned (default and pinned 3.5.4, non-root user),ARGOCD_CONFIG_DIRis set, the state folder is writable and owned by the current user afterargocd-setup,argocd-setupprints its backing and login lines, and the Taskfile lands inincludes.d. Not tested: an actual login or the "login present" branch, the bind-mount override, any task against a server,installTaskfile: false, a failed checksum.
That Feature resolves the binary through nanolayer and the generic
gh-release Feature at build time, without checksum verification. This one
downloads the release binary directly and checks it against the release's
cli_checksums.txt.
Note: This file was auto-generated from the devcontainer-feature.json. Add additional notes to a NOTES.md.