Легковесная реализация Docker HEALTHCHECK
без использования внешних утилит (curl
, wget
и тд.), когда требуется проверять результат HTTP-запроса
к приложению. На примере проверки статуса Java-приложения с включенным модулем
Spring Boot Actuator
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
LINKS="http://winhelp2002.mvps.org/hosts.txt http://someonewhocares.org/hosts/zero/hosts" | |
PATH_ADFREE=/tmp/adfree | |
FILE_HOSTS=$PATH_ADFREE/adhosts | |
FILE_UPDATED=$PATH_ADFREE/updated | |
FILE_RAWLIST=$PATH_ADFREE/raw.list | |
FILE_TOTLIST=$PATH_ADFREE/tot.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ==================================================================== | |
# Вернуть значение метрики "isdayoff" | |
# --- | |
# | |
# Скрипт возвращает: | |
# '0' - если сегодня рабочий день | |
# '1' - если сегодня выходной день | |
# '' - если за сегодня пока не удалось получить статус дня |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: | |
- rabbitmq | |
gather_facts: false roles: | |
- role: dockerized-service | |
vars: | |
service_name: rabbitmq | |
service_port: 5672 | |
management_plugin_port: 15672 | |
dest: /opt/{{ service_name }} | |
compose: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Если задан build-аргумент CICD (любое непустое значение), то брать .NET-образы | |
# из зеркала Docker Registry (Nexus), иначе из Microsoft Container Registry | |
ARG CICD | |
ARG DOTNET_MIRROR_REGISTRY=${CICD:+dotnet} | |
ARG DOTNET_DOCKER_REGISTRY=${DOTNET_MIRROR_REGISTRY:-mcr.microsoft.com/dotnet} | |
#------------------------------------------------------------------------------- | |
FROM ${DOTNET_DOCKER_REGISTRY}/sdk:5.0 AS build | |
... |
find . -type f -iname '*.csproj' -printf '%P\n'
Опция -printf '%P\n'
убирает из имени файла начальную точку поиска (в данном случае ./
).
Вывести только каталоги в каталоге /etc/containerd/certs.d
:
find /etc/containerd/certs.d/ -nowarn -mindepth 1 -maxdepth 1 -type d -printf '%P\n'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd path-to-git-repository | |
if [ `git log --pretty=%H ...refs/heads/master^` == `git ls-remote origin -h refs/heads/master | cut -f1` ]; then | |
exit 1; | |
fi | |
git pull |
NewerOlder