All tools installed in Anvil (other than stable tools installed with dnf
) should be pinned to a specific version. Version pinning ensures that Anvil will behave in a predictable and deterministic way. The specific version number of each tool should be specified using an ARG
instruction in the Dockerfile. To update the pinned version of a tool, edit the ARG
instruction that corresponds to the tool that need to be updated. For example, to update foobar-tool
from v1.0.0 to v2.0.0, change:
ARG FOOBAR_TOOL_VERSION="1.0.0"
to
ARG FOOBAR_TOOL_VERSION="2.0.0"
Tools are installed in Anvil by adding a new RUN command to the Dockerfile. Please use the same format and syntax that exists in the other RUN commands. Clean up any files written to temp directories at the end of the run command.
You must pin the version of the tool you are adding, and add an automated test to the /spec
directory.
There are 3 ways to install a tool in Anvil:
- The DNF package manager
- The asdf version manager
- Manual installations
DNF is a package manager for install RPM packages. Refer to the DNF documentation for details on using DNF.
asdf is a version manager for installing and managing multiple runtime versions of language tools. Refer to the asdf documentation for details on using asdf.
One major caveat with asdf is that when another package manager (e.g., pip
or gem
) is used to install a plugin or library for a language, asdf reshim
must be run afterwards to recreate the shims for the associated package.
Some tools are not available via a package manager. In those cases, tools can be installed manually as described in their documentation. This often involves using wget
to download a binary artifact, or git
to clone a repository and build from source.
Tools installed in Anvil are tested using shellspec. When a new tool is added, a test must also be added to the test directory (/spec/
).
To build a custom version of Anvil that overrides versions of specific tools, use the --build-arg
flag. For example, to build Anvil with v0.21.0 of shellspec:
docker build src/docker -t custom-anvil:local --build-arg SHELLSPEC_VERSION=0.21.0
To customize Anvil with different tools and/or versions:
- Create a fork of the anvil repository
- Change the
GROUP_NAME
and/orIMAGE_NAME
in the Taskfile - Update the relevant
ARG
instructions in the Dockerfile - Build and test the new image
- Push the new image to a Docker repository