mirror of
https://github.com/kasmtech/workspaces-images.git
synced 2024-11-07 08:44:07 +01:00
20 lines
532 B
Bash
Executable File
20 lines
532 B
Bash
Executable File
#!/bin/bash
|
|
|
|
## Parse input ##
|
|
NAME=$1
|
|
BASE=$2
|
|
DOCKERFILE=$3
|
|
|
|
# Determine if we are using private images
|
|
if [ ${USE_PRIVATE_IMAGES} -eq 1 ]; then
|
|
BASE=${BASE}-private
|
|
fi
|
|
|
|
## Build/Push image to cache endpoint by pipeline ID ##
|
|
docker build \
|
|
-t ${ORG_NAME}/image-cache-private:$(arch)-${NAME}-${SANITIZED_BRANCH}-${CI_PIPELINE_ID} \
|
|
--build-arg BASE_IMAGE="${BASE}" \
|
|
--build-arg BASE_TAG="${BASE_TAG}" \
|
|
-f ${DOCKERFILE} .
|
|
docker push ${ORG_NAME}/image-cache-private:$(arch)-${NAME}-${SANITIZED_BRANCH}-${CI_PIPELINE_ID}
|