Backport of commit 09c1e370b3084f7acb7c3777427670a69945368a.
Add configuration and docker definitions for tests and builds in Gitlab CI platform. Some of them currently fail, which is a known problem.