#!/usr/bin/env bash # # SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com) # SPDX-FileContributor: Sebastian Thomschke # SPDX-License-Identifier: Apache-2.0 # SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-gitea-act-runner # source /opt/bash-init.sh ################################################################# # print header ################################################################# if [[ ${1:-} == "" ]]; then cat <<'EOF' _____ _ _ _ _____ / ____(_) | /\ | | | __ \ | | __ _| |_ ___ __ _ / \ ___| |_ | |__) | _ _ __ _ __ ___ _ __ | | |_ | | __/ _ \/ _` | / /\ \ / __| __| | _ / | | | '_ \| '_ \ / _ \ '__| | |__| | | || __/ (_| | / ____ \ (__| |_ | | \ \ |_| | | | | | | | __/ | \_____|_|\__\___|\__,_| /_/ \_\___|\__| |_| \_\__,_|_| |_|_| |_|\___|_| EOF cat /opt/build_info echo log INFO "Timezone is $(date +"%Z %z")" log INFO "Hostname: $(hostname -f)" log INFO "IP Addresses: " awk '/32 host/ { if(uniq[ip]++ && ip != "127.0.0.1") print " - " ip } {ip=$2}' /proc/net/fib_trie fi ################################################################# # start docker deamon (if installed = DinD) ################################################################# if [[ -f /usr/bin/dockerd ]]; then export DOCKER_MODE=dind log INFO "Starting Docker engine..." sudo rm -f /var/run/docker.pid /run/docker/containerd/containerd.pid sudo /usr/local/bin/dind-hack true sudo service docker start while ! docker stats --no-stream &>/dev/null; do log INFO "Waiting for Docker engine to start..." sleep 2 tail -n 1 /var/log/docker.log done export DOCKER_PID=$(