drone-semantic-release/scripts/build_docker.sh
kjuulh f08fee0ada
All checks were successful
continuous-integration/drone/push Build is passing
with docker login
2022-08-21 16:14:45 +02:00

19 lines
386 B
Bash
Executable File

#!/bin/bash
set -e
echo "building docker image"
export DOCKER_BUILDKIT=1
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
latest_tag="$REGISTRY/$SERVICE:latest"
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker build -t "$tag" --cache-from "$latest_tag" -f $TMP/build_docker.Dockerfile .
docker tag "$tag" "$latest_tag"
docker push "$tag" &
docker push "$latest_tag" &
wait