XD-DENG commented on a change in pull request #4049: [AIRFLOW-3203] Fix 
DockerOperator & some operator test
URL: https://github.com/apache/airflow/pull/4049#discussion_r275404195
 
 

 ##########
 File path: airflow/operators/docker_operator.py
 ##########
 @@ -187,35 +188,28 @@ def execute(self, context):
                 tls=tls_config
             )
 
-        if ':' not in self.image:
-            image = self.image + ':latest'
-        else:
-            image = self.image
 
 Review comment:
   Hi @feluelle the change was made based on the facts below:
   
   1. For **`pull`**: 
https://docker-py.readthedocs.io/en/stable/api.html#docker.api.image.ImageApiMixin.pull
  In the example, you can find that the `latest` tag is used if no tag is 
provided together with the repo.
   
   2. For **`create_container`**: you can try to code below
   
   ```python
   import docker
   client = docker.APIClient(base_url='unix://var/run/docker.sock')
   client.create_container(image="fake_image")
   ```
   It will give you error "ImageNotFound: 404 Client Error: Not Found ("No such 
image: `fake_image:latest`")"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to