diff --git a/templates/gitlab-ci-docker.yml b/templates/gitlab-ci-docker.yml
index 2458cfadad4ca0567829d11d8b70c4d79f6b4969..17b6e7f411a5cdd0621d5942d8abadb5f0b450da 100644
--- a/templates/gitlab-ci-docker.yml
+++ b/templates/gitlab-ci-docker.yml
@@ -352,6 +352,30 @@ stages:
     fi
   }
 
+  function maybe_install_awk() {
+    if ! command -v awk > /dev/null
+    then
+      if command -v apt-get > /dev/null
+      then
+        # Debian
+        apt-get update
+        apt-get install --no-install-recommends --yes --quiet awk
+      elif command -v apk > /dev/null
+      then
+        # Alpine
+        apk add --no-cache gawk
+      elif command -v dnf > /dev/null
+      then 
+        # Fedora
+        dnf install -y -q awk
+      else
+        log_error "... didn't find any supported package manager to install awk"
+        exit 1
+      fi
+    fi
+  }
+
+
   function unscope_variables() {
     _scoped_vars=$(env | awk -F '=' "/^scoped__[a-zA-Z0-9_]+=/ {print \$1}" | sort)
     if [[ -z "$_scoped_vars" ]]; then return; fi
@@ -684,6 +708,7 @@ stages:
   }
 
   function init_workspace() {
+    maybe_install_awk
     install_custom_ca_certs
     unscope_variables
     eval_all_secrets