Selaa lähdekoodia

replace / for tag (#2550)

Xingyao Wang 1 vuosi sitten
vanhempi
sitoutus
eac05d71fa
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      opendevin/runtime/docker/image_agnostic_util.py

+ 4 - 3
opendevin/runtime/docker/image_agnostic_util.py

@@ -27,7 +27,7 @@ def generate_dockerfile_content(base_image: str) -> str:
 
 
 def _build_sandbox_image(
-        base_image: str, target_image_name: str, docker_client: docker.DockerClient
+    base_image: str, target_image_name: str, docker_client: docker.DockerClient
 ):
     try:
         with tempfile.TemporaryDirectory() as temp_dir:
@@ -61,10 +61,11 @@ def _build_sandbox_image(
 
 
 def _get_new_image_name(base_image: str) -> str:
-    if ":" not in base_image:
-        base_image = base_image + ":latest"
+    if ':' not in base_image:
+        base_image = base_image + ':latest'
 
     [repo, tag] = base_image.split(':')
+    repo = repo.replace('/', '___')
     return f'od_sandbox:{repo}__{tag}'