From 784cea583cb62cdc0db10bec9f773c9489bddb4f Mon Sep 17 00:00:00 2001 From: Johann Frei Date: Thu, 22 Apr 2021 00:21:10 +0200 Subject: [PATCH] Patch compose file only once --- .../offline_01_2-patch_and_extract_Docker_images.sh | 2 +- offline_deployment/offline_02_2-import_Docker_images.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh b/offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh index 29aa4d8c..ce2f127f 100755 --- a/offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh +++ b/offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh @@ -9,7 +9,7 @@ echo "Patching docker-compose to match Ubuntu 18.04 compose package" sed -i 's|version: "3.7"|version: "3.3"|g' ../docker-compose.prod.yml sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml -sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml +sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml # Modify Dockerfile for nginx to add python3 and offline patch sed -i 's|FROM nginx|COPY offline_deployment/offline_patcher.py /patch.py\ diff --git a/offline_deployment/offline_02_2-import_Docker_images.sh b/offline_deployment/offline_02_2-import_Docker_images.sh index 38bebefc..a124ec9d 100755 --- a/offline_deployment/offline_02_2-import_Docker_images.sh +++ b/offline_deployment/offline_02_2-import_Docker_images.sh @@ -4,9 +4,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR unset DIR -# Set image tag in Compose to avoid image build -sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml -sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml +# Info: Docker image name is already set in previous scripts +## Set image tag in Compose to avoid image build +#sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml +#sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml # Load docker images docker image load -i doccano-backend.tar