Skip to content

Commit

Permalink
feat: add sotrage-driver-setup.sh to avoid wrong filesystem durin…
Browse files Browse the repository at this point in the history
…g Docker build.
  • Loading branch information
Kungger-git committed Apr 18, 2022
1 parent f6e1a5f commit 97fe627
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions storage-driver-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi

_file="/etc/docker/daemon.json"
_service="docker.service"

## Stop Docker Service
if [[ $(systemctl is-active ${_service}) == "active" ]]; then
systemctl stop ${_service}
fi

## Create daemon.json file along with the following lines.
if [[ ! -f ${_file} ]]; then
echo "{
\"storage-driver\": \"vfs\"
}" > ${_file}
fi

## Start Docker Service
systemctl start ${_service}

0 comments on commit 97fe627

Please sign in to comment.