This patch consolidates the exec package for docker build so that it uses the the go-execute package used in other OpenFaaS projects. The aim is to allow for conditional printing of stdio whilst also being able to capture the output. In a future PR a CLI animation can replace the Docker build, which will be default, but optional. If an error is found then the result of the build will be buffered and available to print to the user. This change stops Docker from printing progress bars when downloading layers. Instead a line is printed when pulling and when a layer is complete. * Tested for faas-cli build with multiple functions using the sample stack.yml and --parallel=1/4. * Adds StreamStdio option and updates Docker build version to use Go 1.12. * Add complete build time to output * Add duration of each build to output * Add --quiet flag for faas-cli build * The --quiet flag hides output from Docker during the execution of the docker build. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
22 lines
402 B
Bash
Executable File
22 lines
402 B
Bash
Executable File
#!/bin/bash
|
|
|
|
export eTAG="latest-dev"
|
|
echo $1
|
|
if [ $1 ] ; then
|
|
eTAG=$1
|
|
fi
|
|
|
|
echo Building openfaas/faas-cli:$eTAG
|
|
|
|
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t openfaas/faas-cli:$eTAG .
|
|
|
|
if [ $? == 0 ] ; then
|
|
|
|
docker create --name faas-cli openfaas/faas-cli:$eTAG && \
|
|
docker cp faas-cli:/usr/bin/faas-cli . && \
|
|
docker rm -f faas-cli
|
|
|
|
else
|
|
exit 1
|
|
fi
|