Skip to content

Commit

Permalink
Fixed issue with docker not running in linux on first install (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen committed Sep 12, 2023
1 parent 4239907 commit c2f756b
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions assets/scripts/configure-microk8s-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,23 @@ bash "$SCRIPTS_FOLDER/check-docker-compose.sh" "$PASSWORD"

checkExitCode

#================================
# Docker MicroK8s Registry access
#================================

if [[ -f "/etc/docker/daemon.json" ]]; then
echo "daemon.json file exists at /etc/docker/daemon.json"
else
if [[ ! -d "/etc/docker" ]]; then
echo "$PASSWORD" | sudo -S mkdir "/etc/docker"
fi

echo "$PASSWORD" | sudo -S -- sh -c "echo '{\"insecure-registries\" : [\"localhost:32000\"]}' >>/etc/docker/daemon.json"
echo "daemon.json file created at /etc/docker/daemon.json"

echo "$PASSWORD" | sudo -S systemctl restart docker
fi

#============================
# Ensure DB and Redis Running
#============================
Expand All @@ -183,23 +200,6 @@ bash "$SCRIPTS_FOLDER/check-helm.sh" "$PASSWORD"

checkExitCode

#================================
# Docker MicroK8s Registry access
#================================

if [[ -f "/etc/docker/daemon.json" ]]; then
echo "daemon.json file exists at /etc/docker/daemon.json"
else
if [[ ! -d "/etc/docker" ]]; then
echo "$PASSWORD" | sudo -S mkdir "/etc/docker"
fi

echo "$PASSWORD" | sudo -S -- sh -c "echo '{\"insecure-registries\" : [\"localhost:32000\"]}' >>/etc/docker/daemon.json"
echo "daemon.json file created at /etc/docker/daemon.json"

echo "$PASSWORD" | sudo -S systemctl restart docker
fi

#================
# Verify MicroK8s
#================
Expand Down

0 comments on commit c2f756b

Please sign in to comment.