#!/bin/bash
echo $image_name:$tag 
sudo docker build -t $image_name:$tag -f Dockerfile .
sudo docker logout registry.gitlab.com
echo "Login to gitlab registry"
echo "$CI_REGISTRY_PW"
echo "$CI_REGISTRY_USER"
echo "$CI_REGISTRY_PW" | sudo docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
echo "image tag"
echo "$tag"
sudo docker push $image_name:$tag