Build: Docker: Dev: Added build/clean base images by default
This commit is contained in:
parent
6bb5c28a9f
commit
ceead77137
@ -23,6 +23,14 @@ echo "SERVICE_LOGIN: $login"
|
|||||||
echo "SERVICE_CLIENT: $client"
|
echo "SERVICE_CLIENT: $client"
|
||||||
echo "APP_URL_PORTAL: $portal_url"
|
echo "APP_URL_PORTAL: $portal_url"
|
||||||
|
|
||||||
|
force=false
|
||||||
|
|
||||||
|
if [ "$1" = "--force" ]; then
|
||||||
|
force=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "FORCE BUILD BASE IMAGES: $force"
|
||||||
|
|
||||||
# Stop all backend services"
|
# Stop all backend services"
|
||||||
$dir/build/start/stop.backend.docker.sh
|
$dir/build/start/stop.backend.docker.sh
|
||||||
|
|
||||||
@ -48,26 +56,43 @@ rm -rf $dir/publish
|
|||||||
echo "Build backend services (to "publish/" folder)"
|
echo "Build backend services (to "publish/" folder)"
|
||||||
bash $dir/build/install/common/build-services.sh -pb backend-publish -pc Debug -de "$dockerDir/docker-entrypoint.py"
|
bash $dir/build/install/common/build-services.sh -pb backend-publish -pc Debug -de "$dockerDir/docker-entrypoint.py"
|
||||||
|
|
||||||
proxy_version=v1.0.0
|
dotnet_version=dev
|
||||||
|
|
||||||
if [ "$1" = "--build_proxy" ]; then
|
exists=$(docker images | egrep "onlyoffice/4testing-docspace-dotnet-runtime" | egrep "$dotnet_version" | awk 'NR>0 {print $1 ":" $2}')
|
||||||
proxy_version=v9.9.9
|
|
||||||
|
|
||||||
exists=$(docker images | egrep "onlyoffice/4testing-docspace-proxy-runtime" | egrep "$proxy_version" | awk 'NR>0 {print $1 ":" $2}')
|
if [ "${exists}" = "" ] || [ "$force" = true ]; then
|
||||||
|
echo "Build dotnet base image from source (apply new dotnet config)"
|
||||||
if [ "${exists}" = "" ]; then
|
docker build -t onlyoffice/4testing-docspace-dotnet-runtime:$dotnet_version -f ./build/install/docker/Dockerfile.runtime --target dotnetrun .
|
||||||
echo "Build proxy base image from source (apply new nginx config)"
|
else
|
||||||
docker build -t onlyoffice/4testing-docspace-proxy-runtime:$proxy_version -f ./build/install/docker/Dockerfile.runtime --target proxy .
|
echo "SKIP build dotnet base image (already exists)"
|
||||||
else
|
|
||||||
echo "SKIP build proxy base image (already exists)"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
node_version=dev
|
||||||
|
|
||||||
|
exists=$(docker images | egrep "onlyoffice/4testing-docspace-nodejs-runtime" | egrep "$node_version" | awk 'NR>0 {print $1 ":" $2}')
|
||||||
|
|
||||||
|
if [ "${exists}" = "" ] || [ "$force" = true ]; then
|
||||||
|
echo "Build nodejs base image from source"
|
||||||
|
docker build -t onlyoffice/4testing-docspace-nodejs-runtime:$node_version -f ./build/install/docker/Dockerfile.runtime --target noderun .
|
||||||
|
else
|
||||||
|
echo "SKIP build nodejs base image (already exists)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
proxy_version=dev
|
||||||
|
|
||||||
|
exists=$(docker images | egrep "onlyoffice/4testing-docspace-proxy-runtime" | egrep "$proxy_version" | awk 'NR>0 {print $1 ":" $2}')
|
||||||
|
|
||||||
|
if [ "${exists}" = "" ] || [ "$force" = true ]; then
|
||||||
|
echo "Build proxy base image from source (apply new nginx config)"
|
||||||
|
docker build -t onlyoffice/4testing-docspace-proxy-runtime:$proxy_version -f ./build/install/docker/Dockerfile.runtime --target proxy .
|
||||||
|
else
|
||||||
|
echo "SKIP build proxy base image (already exists)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Run migration and services"
|
echo "Run migration and services"
|
||||||
ENV_EXTENSION="dev" \
|
ENV_EXTENSION="dev" \
|
||||||
Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:v1.0.0" \
|
Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:$dotnet_version" \
|
||||||
Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:v1.0.0" \
|
Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:$node_version" \
|
||||||
Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:$proxy_version" \
|
Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:$proxy_version" \
|
||||||
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver-de:latest \
|
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver-de:latest \
|
||||||
SERVICE_DOCEDITOR=$doceditor \
|
SERVICE_DOCEDITOR=$doceditor \
|
||||||
|
@ -12,9 +12,9 @@ then
|
|||||||
echo "Remove all backend containers"
|
echo "Remove all backend containers"
|
||||||
|
|
||||||
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver-de:latest \
|
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver-de:latest \
|
||||||
Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:v1.0.0" \
|
Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:dev" \
|
||||||
Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:v1.0.0" \
|
Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:dev" \
|
||||||
Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:v1.0.0" \
|
Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:dev" \
|
||||||
SERVICE_CLIENT="localhost:5001" \
|
SERVICE_CLIENT="localhost:5001" \
|
||||||
BUILD_PATH="/var/www" \
|
BUILD_PATH="/var/www" \
|
||||||
SRC_PATH="${RootDir}/publish/services" \
|
SRC_PATH="${RootDir}/publish/services" \
|
||||||
@ -28,6 +28,9 @@ then
|
|||||||
echo "Remove docker volumes"
|
echo "Remove docker volumes"
|
||||||
docker volume prune -f -a
|
docker volume prune -f -a
|
||||||
|
|
||||||
|
echo "Remove docker base images (onlyoffice/4testing-docspace)"
|
||||||
|
docker rmi -f $(docker images -a | egrep "onlyoffice/4testing-docspace" | awk 'NR>0 {print $3}')
|
||||||
|
|
||||||
echo "Remove unused networks."
|
echo "Remove unused networks."
|
||||||
docker network prune -f
|
docker network prune -f
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user