2022-08-21 14:57:32 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-08-21 16:07:08 +02:00
|
|
|
echo "building docker image"
|
|
|
|
|
2022-08-21 15:29:42 +02:00
|
|
|
export DOCKER_BUILDKIT=1
|
|
|
|
|
2022-08-21 16:07:08 +02:00
|
|
|
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
|
|
|
|
latest_tag="$REGISTRY/$SERVICE:latest"
|
|
|
|
|
2022-08-21 16:14:45 +02:00
|
|
|
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
|
|
|
|
2022-08-21 16:10:33 +02:00
|
|
|
docker build -t "$tag" --cache-from "$latest_tag" -f $TMP/build_docker.Dockerfile .
|
2022-08-21 16:11:56 +02:00
|
|
|
docker tag "$tag" "$latest_tag"
|
|
|
|
docker push "$tag" &
|
|
|
|
docker push "$latest_tag" &
|
|
|
|
wait
|