prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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
  
  </issue>
  <code>
  [start of docker/build.py]
  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 of docker/build.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
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"}]}