clamav/.devcontainer/README.md
John Humlick 4add43f4ad
Add devcontainer (#1462)
ClamAV supports multiple platforms and sometimes requires the
debugging of platform-specific bugs.

This commit adds one devcontainer for Debian and another for
AlmaLinux so that the codebase can be reopened inside of a
devcontainer for debugging/testing purposes.

Jira: CLAM-2740

---------

Signed-off-by: John Humlick <15677335+jhumlick@users.noreply.github.com>
2025-08-12 13:03:48 -04:00

1.7 KiB

Instructions for using these dev containers

Dependencies

  1. The host platform is Linux or macOS.
  2. Docker or Docker Desktop are installed and the local user has permissions to use the Docker daemon.
  3. You must have a directory $HOME/data/cvd for the Dev Container to mount as the ClamAV database directory. See below for setup instructions.
  4. ssh-agent must be running to share Git credentials with the container. See below for setup instructions.
  5. The UID environment variable must be set to export your user's ID. See below for setup instructions.

Set up database directory mount path

Create a database directory for sharing signature files from the host to the dev container:

mkdir -p $HOME/data/cvd

Place any ClamAV signature files in this directory that you want to make available to the dev container.

Tip: If you want to change this directory, edit the path in the devcontainer.json file. Or, if you want to install signature files on the container itself, comment out the line that mounts this directory in the devcontainer.json file.

Set up UID user ID environment variable.

For Bash shell, edit $HOME/.bashrc. Or for Zsh, edit $HOME/.zshrc. Add the following:

export UID=$(id -u)

Source this file (e.g. run source $HOME/.bashrc or source $HOME/.zshrc) to apply this change in your current shell. Or open a new terminal.

VSCode Setup

  1. Install the following extensions:
    1. Dev containers - Microsoft
    2. Container Tools - Microsoft
    3. Docker - Microsoft
    4. Remote Development - Microsoft
  2. Click the green icon in the bottom-left corner of the VSCode window (or press F1)
  3. Select Dev Containers: Reopen in Container
  4. Select the devcontainer.json file for the container you wish to open.