This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new fab143b262f [fix][ci][branch-3.0] Modify existing 
/etc/docker/daemon.json file if it exists
fab143b262f is described below

commit fab143b262f556114dc5db73806e571bcf6cb159
Author: Lari Hotari <[email protected]>
AuthorDate: Mon Feb 10 09:41:52 2025 +0200

    [fix][ci][branch-3.0] Modify existing /etc/docker/daemon.json file if it 
exists
    
    - In branch-3.0, -Ddocker.squash=true is used and it relies on experimental 
key set to true
      in daemon.json. The docker image build fails with "connection reset by 
peer" if squash is requested
      and the daemon doesn't support it.
      - The daemon.json file was overridden with #23909 changes and the 
experimental setting got removed.
---
 .github/actions/clean-disk/action.yml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.github/actions/clean-disk/action.yml 
b/.github/actions/clean-disk/action.yml
index e67ce59a08d..fae68b86da9 100644
--- a/.github/actions/clean-disk/action.yml
+++ b/.github/actions/clean-disk/action.yml
@@ -49,7 +49,14 @@ runs:
           if [[ "${{ inputs.mode }}" == "full" ]]; then
             echo "::group::Moving /var/lib/docker to /mnt/docker"
             sudo systemctl stop docker
-            echo '{"data-root": "/mnt/docker"}' | sudo tee 
/etc/docker/daemon.json
+            if sudo test ! -f /etc/docker/daemon.json; then
+              # create daemon.json file
+              echo '{"data-root": "/mnt/docker"}' | sudo tee 
/etc/docker/daemon.json
+            else
+              # modify existing daemon.json file
+              sudo jq '.["data-root"]="/mnt/docker"' /etc/docker/daemon.json | 
sudo tee /tmp/daemon_temp.json$$
+              sudo mv /tmp/daemon_temp.json$$ /etc/docker/daemon.json
+            fi
             sudo mv /var/lib/docker /mnt/docker
             sudo systemctl start docker
             time df -BM / /mnt

Reply via email to