prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Tag Docker versions
  Currently, GitHub Action will deploy a new version to dockerhub as a `latest`. We need to push the tagged version per MindsDB version e.g 2.62.5 => mindsdb/mindsdb:2.62.5
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docker/build.py`
  Content:
  ```
  1 import os
  2 import sys
  3 import requests
  4 import subprocess
  5 
  6 installer_version_url = 'https://public.api.mindsdb.com/installer/@@beta_or_release/docker___success___None'
  7 
  8 api_response = requests.get(
  9     installer_version_url.replace('@@beta_or_release', sys.argv[1]))
  10 
  11 if api_response.status_code != 200:
  12     exit(1)
  13 
  14 installer_version = api_response.text
  15 
  16 os.system('mkdir -p dist')
  17 
  18 if sys.argv[1] == 'release':
  19     container_name = 'mindsdb'
  20     dockerfile_template = 'dockerfile_release.template'
  21 
  22 elif sys.argv[1] == 'beta':
  23     container_name = 'mindsdb_beta'
  24     dockerfile_template = 'dockerfile_beta.template'
  25 
  26 with open(dockerfile_template, 'r') as fp:
  27     content = fp.read()
  28     content = content.replace('@@beta_or_release', sys.argv[1])
  29     content = content.replace('@@installer_version', installer_version)
  30 
  31 with open('dist/Dockerfile', 'w') as fp:
  32     fp.write(content)
  33 
  34 command = (f"""
  35         cd dist &&
  36         docker build -t {container_name} . &&
  37         docker tag {container_name} mindsdb/{container_name}:latest &&
  38         docker tag {container_name} mindsdb/{container_name}:{installer_version} &&
  39         docker push mindsdb/{container_name};
  40         cd ..
  41       """)
  42 
  43 subprocess.run(command, shell=True, check=True)
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/docker/build.py b/docker/build.py
  --- a/docker/build.py
  +++ b/docker/build.py
  @@ -31,13 +31,11 @@
   with open('dist/Dockerfile', 'w') as fp:
       fp.write(content)
   
  +print(installer_version)
   command = (f"""
           cd dist &&
  -        docker build -t {container_name} . &&
  -        docker tag {container_name} mindsdb/{container_name}:latest &&
  -        docker tag {container_name} mindsdb/{container_name}:{installer_version} &&
  -        docker push mindsdb/{container_name};
  -        cd ..
  +        docker build -t mindsdb/{container_name}:latest -t mindsdb/{container_name}:{installer_version} . &&
  +        docker push mindsdb/{container_name} --all-tags
         """)
   
   subprocess.run(command, shell=True, check=True)
  \ No newline at end of file
  
verification_info: {"golden_diff": "diff --git a/docker/build.py b/docker/build.py\n--- a/docker/build.py\n+++ b/docker/build.py\n@@ -31,13 +31,11 @@\n with open('dist/Dockerfile', 'w') as fp:\n     fp.write(content)\n \n+print(installer_version)\n command = (f\"\"\"\n         cd dist &&\n-        docker build -t {container_name} . &&\n-        docker tag {container_name} mindsdb/{container_name}:latest &&\n-        docker tag {container_name} mindsdb/{container_name}:{installer_version} &&\n-        docker push mindsdb/{container_name};\n-        cd ..\n+        docker build -t mindsdb/{container_name}:latest -t mindsdb/{container_name}:{installer_version} . &&\n+        docker push mindsdb/{container_name} --all-tags\n       \"\"\")\n \n subprocess.run(command, shell=True, check=True)\n\\ No newline at end of file\n", "issue": "Tag Docker versions\nCurrently, GitHub Action will deploy a new version to dockerhub as a `latest`. We need to push the tagged version per MindsDB version e.g 2.62.5 => mindsdb/mindsdb:2.62.5\n", "before_files": [{"content": "import os\nimport sys\nimport requests\nimport subprocess\n\ninstaller_version_url = 'https://public.api.mindsdb.com/installer/@@beta_or_release/docker___success___None'\n\napi_response = requests.get(\n    installer_version_url.replace('@@beta_or_release', sys.argv[1]))\n\nif api_response.status_code != 200:\n    exit(1)\n\ninstaller_version = api_response.text\n\nos.system('mkdir -p dist')\n\nif sys.argv[1] == 'release':\n    container_name = 'mindsdb'\n    dockerfile_template = 'dockerfile_release.template'\n\nelif sys.argv[1] == 'beta':\n    container_name = 'mindsdb_beta'\n    dockerfile_template = 'dockerfile_beta.template'\n\nwith open(dockerfile_template, 'r') as fp:\n    content = fp.read()\n    content = content.replace('@@beta_or_release', sys.argv[1])\n    content = content.replace('@@installer_version', installer_version)\n\nwith open('dist/Dockerfile', 'w') as fp:\n    fp.write(content)\n\ncommand = (f\"\"\"\n        cd dist &&\n        docker build -t {container_name} . &&\n        docker tag {container_name} mindsdb/{container_name}:latest &&\n        docker tag {container_name} mindsdb/{container_name}:{installer_version} &&\n        docker push mindsdb/{container_name};\n        cd ..\n      \"\"\")\n\nsubprocess.run(command, shell=True, check=True)", "path": "docker/build.py"}], "after_files": [{"content": "import os\nimport sys\nimport requests\nimport subprocess\n\ninstaller_version_url = 'https://public.api.mindsdb.com/installer/@@beta_or_release/docker___success___None'\n\napi_response = requests.get(\n    installer_version_url.replace('@@beta_or_release', sys.argv[1]))\n\nif api_response.status_code != 200:\n    exit(1)\n\ninstaller_version = api_response.text\n\nos.system('mkdir -p dist')\n\nif sys.argv[1] == 'release':\n    container_name = 'mindsdb'\n    dockerfile_template = 'dockerfile_release.template'\n\nelif sys.argv[1] == 'beta':\n    container_name = 'mindsdb_beta'\n    dockerfile_template = 'dockerfile_beta.template'\n\nwith open(dockerfile_template, 'r') as fp:\n    content = fp.read()\n    content = content.replace('@@beta_or_release', sys.argv[1])\n    content = content.replace('@@installer_version', installer_version)\n\nwith open('dist/Dockerfile', 'w') as fp:\n    fp.write(content)\n\nprint(installer_version)\ncommand = (f\"\"\"\n        cd dist &&\n        docker build -t mindsdb/{container_name}:latest -t mindsdb/{container_name}:{installer_version} . &&\n        docker push mindsdb/{container_name} --all-tags\n      \"\"\")\n\nsubprocess.run(command, shell=True, check=True)", "path": "docker/build.py"}]}