1
0
intel-media-ffmpeg/scripts/build-dockerfile
James P. Ketrenos e871288b5d Added some snippet info on tagging and pushing to Harbor
Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
2019-09-17 16:02:45 -07:00

74 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Bring in the variables from SOLUTION file
#
export $(grep -v '^#' SOLUTION | xargs -d '\n')
export $(grep -v '^#' MANIFEST | xargs -d '\n')
# Remove the Dockerfile if it exists; should check
# if it is clean first, and abort if not.
#
[ -e Dockerfile ] && rm Dockerfile
cat << EOM > Dockerfile
#
# DO NOT EDIT THIS DOCKERFILE
#
# This file is auto-generated via scripts/build-dockerfile
# by using environment substitution while concatenating the
# contents of templates/*, and then adding the contents
# of Dockerfile.solution
#
# Most solution specific changes should be isolated in
# Dockerfile.solution. After making changes, you can
# then re-run scripts/build-dockerfile
#
EOM
for snippet in templates/??-*.in; do
cat << EOM >> Dockerfile
#
# Template $snippt begins here (from templates/${snippet})
#
EOM
envsubst < $snippet >> Dockerfile
done
cat << EOM >> Dockerfile
#
# Solution begins here (from Dockerfile.solution)
#
EOM
envsubst < Dockerfile.solution >> Dockerfile
cat << EOM >> Dockerfile
#
# Standard ending begins here (from templates/ending.in)
#
EOM
envsubst < templates/ending.in >> Dockerfile
docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION}
cat << EOM
If the build looks good, you should commit the changes
to Dockerfile and tag it as agama-${AGAMA_VERSION}:
git commit -s -a -m "Build of agama-${AGAMA_VERSION}"
git tag -f agama-${AGAMA_VERSION}
To push to Harbor:
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION}
docker tag ${CONTAINER}:agama-${AGAMA_VERSION} amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest
docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:agama-${AGAMA_VERSION}
docker push amr-registry.caas.intel.com/vtt-osgc/solutions/${CONTAINER}:latest
EOM