# build the go app, then wrap it in an image stages: - build - test - package build:go: stage: build image: andrexus/golang-dep tags: - runner:k8s script: - time dep ensure - go build variables: GOPATH: /build artifacts: paths: - home-dns expire_in: 1 hour cache: key: "${CI_COMMIT_REF_SLUG}" untracked: true package:docker: stage: package image: docker:stable services: - docker:stable-dind tags: - runner:k8s dependencies: - build:go before_script: - mkdir /root/.docker - ln -s /secrets/docker /root/.docker/config.json - docker info script: - docker build -t $IMAGE_TAG . - docker push $IMAGE_TAG variables: DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://localhost:2375 IMAGE_TAG: ssube/home-dns:$CI_COMMIT_REF_SLUG