Files
han-app/ops-monitoring/Обновление clamav образа.md
T

70 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### 1. Получите digest локально
В WSL:
```sh
docker pull --platform linux/amd64 clamav/clamav:1.4.6
docker image inspect clamav/clamav:1.4.6 \
--format '{{index .RepoDigests 0}}'
```
Получите значение вида:
```text
clamav/clamav@sha256:<DIGEST>
```
### 2. Обновите `.env`
Локально и на ВМ замените:
```dotenv
CLAMAV_IMAGE=clamav/clamav@sha256:<НОВЫЙ_DIGEST>
```
На ВМ предварительно сохраните резервную копию:
```sh
cd /opt/han-chat/services
cp -a .env ".env.before-clamav-1.4.6-$(date +%Y%m%d-%H%M%S)"
editor .env
```
Не указывайте в production только тег `:1.4.6` — нужен digest.
### 3. Загрузите и пересоздайте контейнеры
```sh
cd /opt/han-chat/services
deployment/preflight.sh
/usr/local/sbin/han-vm2-compose config --quiet
/usr/local/sbin/han-vm2-compose config --images
/usr/local/sbin/han-vm2-compose pull clamd freshclam
/usr/local/sbin/han-vm2-compose up -d --force-recreate \
freshclam clamd
```
Не используйте `down -v`: volume сигнатур должен сохраниться.
### 4. Проверка
Через несколько минут:
```sh
/usr/local/sbin/han-vm2-compose ps clamd freshclam
/usr/local/sbin/han-vm2-compose exec -T clamd \
clamdscan --version
/usr/local/sbin/han-vm2-compose exec -T clamd \
clamdscan --ping 1
/usr/local/sbin/han-vm2-compose logs --no-color --since 10m \
clamd freshclam
```
Ожидается версия `1.4.6`, `clamd``healthy`, `freshclam``Up`. CDN cooldown сохранится до указанного времени; обходить его удалением файлов или volume не нужно.