Files
faas-cli/build.sh
Utsav Anand 372d120c34 Add root user for faas-cli invokation
Adds a new target stage for faas-cli's Docker image having a root user that can be used with
CI/CD environments like Google Cloud Build.
Also add a [Breaking Change] that switches from using `CMD` in the Dockerfile to `ENTRYPOINT`
which allows overriding commands in CI/CD environments.

Signed-off-by: Utsav Anand <utsavanand2@gmail.com>
2020-06-29 16:58:27 +01:00

26 lines
597 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 --target release -t openfaas/faas-cli:$eTAG .
echo Building openfaas/faas-cli:$eTAG-root
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --target root -t openfaas/faas-cli:$eTAG-root .
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