Facing some problems with setting up Docker Edge (with Kubernetes) via script

I am working on a script for Mac and Windows for doing a Kubernetes deployment, which does the following:

Step 1. Set the user up with Docker Edge (thanks for that, setting up a Kubernetes cluster is way too easy now) if already not installed on the host machine, OR, upgrade an existing docker version to a Docker Edge version, without deleting the containers and images.

Step 2. Configure the Docker RAM memory allotment settings, based on the user input (at least 4gb as our container has that prerequisite).

Step 3. Now once steps 1 and 2 are done, configure the Docker, with a cluster, and, deploy the container using Kubernetes (docker-for-desktop).

So, in a nutshell, I am working on a script which automates everything, so that, the user doesn’t have to deal with them individually.

However, I am stuck at implementing the steps 1 and 2.

In step 1, I am not sure regarding how to upgrade the docker to a Docker Edge version without killing the existing containers and the images. I did not find much documentation on this topic.

In step 2, I am not sure regarding how to change the RAM memory settings from the script itself (not using the GUI), again, I did not find any documentation regarding how this could be done.

Can you please provide help with these issues? Any help would be appreciated.

Thanks!