diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cc1bb5ab1113606769d5bf4b8517efe2d5e4b5cc..0d8c7bf7635e934809cc461c3c6fbdec2c188a2d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,10 +29,6 @@ stages:
 
 .build:push: &build-push
   <<: *build
-  image: alpine:edge
-  before_script:
-    - apk add --no-cache bash build-base cmake python3 libexecinfo-dev cppunit-dev libxml2-dev tclap-dev readline-dev qt5-qtbase-dev graphviz-dev jsoncpp-dev ${EXTRA_PKGS}
-    - export CXX=${CXX}
   except:
     variables:
       - $SCHEDULED_NIGHTLY
@@ -45,13 +41,16 @@ stages:
 
 build:alpine:gcc:
   <<: *build-push
-  variables:
-    CXX: g++
+  image: alpine:edge
+  before_script:
+    - apk add --no-cache bash build-base cmake python3 libexecinfo-dev cppunit-dev libxml2-dev tclap-dev readline-dev qt5-qtbase-dev graphviz-dev jsoncpp-dev
 
 build:alpine:clang:
   <<: *build-push
+  image: alpine:edge
+  before_script:
+    - apk add --no-cache bash build-base cmake python3 libexecinfo-dev cppunit-dev libxml2-dev tclap-dev readline-dev qt5-qtbase-dev graphviz-dev jsoncpp-dev clang
   variables:
-    EXTRA_PKGS: clang
     CXX: clang++
 
 # build:debian:stable:
@@ -133,9 +132,6 @@ build:doc:
 
 .test:push: &test-push
   <<: *test
-  image: alpine:edge
-  before_script:
-    - apk add --no-cache bash bc coreutils python3 cmake make libexecinfo cppunit libxml2 tclap readline qt5-qtbase qt5-qtbase-x11 graphviz jsoncpp
   except:
     variables:
       - $SCHEDULED_NIGHTLY
@@ -148,11 +144,17 @@ build:doc:
 
 test:alpine:gcc:
   <<: *test-push
+  image: alpine:edge
+  before_script:
+    - apk add --no-cache bash bc coreutils python3 cmake make libexecinfo cppunit libxml2 tclap readline qt5-qtbase qt5-qtbase-x11 graphviz jsoncpp
   dependencies:
     - build:alpine:gcc
 
 test:alpine:clang:
   <<: *test-push
+  image: alpine:edge
+  before_script:
+    - apk add --no-cache bash bc coreutils python3 cmake make libexecinfo cppunit libxml2 tclap readline qt5-qtbase qt5-qtbase-x11 graphviz jsoncpp
   dependencies:
     - build:alpine:clang