You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently everytime we persist the databases another copy of the databases is put into the docker image. This causes the image size to grow significantly.
Consider a multi stage approach where the database files are persisted in a clean mssql image.
The text was updated successfully, but these errors were encountered:
$InstallPath = "$env:INSTALL_PATH"
$DataPath = "$env:DATA_PATH"
$imagename = "project-mssql"
$containername = "sitecore-xp-mssql"
$baseimagename =sitecore-xp-mssql
$intermediateContainerName = "intermediate-" + $containername
docker create $baseimagename --name $intermediateContainername #create a new container based on the clean mssql container (contains no databases files)
docker cp $containername:$DataPath $intermediateContainername:$InstallPath #copy the database files to the temporary container
docker commit $intermediateContainername $imagename #commit the temporary container, overwritting the old image
#do some cleanup
So the idea is to copy the files to a temporary intermediate container that uses the base image and then commit that container under the required image name.
Currently everytime we persist the databases another copy of the databases is put into the docker image. This causes the image size to grow significantly.
Consider a multi stage approach where the database files are persisted in a clean mssql image.
The text was updated successfully, but these errors were encountered: