#!/bin/sh

/usr/sbin/update-ca-certificates

while ! /usr/bin/gosu harbor:harbor /usr/bin/docker ps &> /dev/null; do
  echo "Waiting for docker to start..."
  sleep 5
done

# Enable the harbor user to run ctr commands
chown -R root:harbor /run/containerd/docker-containerd.sock

exec /usr/bin/gosu harbor:harbor /usr/local/bin/run-harbor-tests.sh
