Ian Truslove created AIRFLOW-5022:
-------------------------------------

             Summary: DockerHook ignores connection port
                 Key: AIRFLOW-5022
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5022
             Project: Apache Airflow
          Issue Type: Bug
          Components: hooks, operators
    Affects Versions: 1.10.3
            Reporter: Ian Truslove


I have a DAG with a DockerOperator whose Docker image is hosted in a private 
registry. Passing a connection with creds to access the registry doesn't work - 
I get access errors like this:

{{[2019-07-22 18:29:36,734] \{{__init__.py:1580}} ERROR - 500 Server Error: 
Internal Server Error ("Get 
https://<my.internal.url>:2345/v2/foo/bar/manifests/dd92a47df2f3d2c82775552b765013d3c60a2f34}}{{:
 denied: access forbidden") }}

and the image is not retrieved.

I am quite sure I am passing the correct credentials.

Digging in a bit, I saw that docker_hook doesn't use the connection's _port_ 
property. I definitely do have my registry exposed at a non-standard port 
number.

I hacked a fix directly in to my Airflow, and this does solve the problem.

I replaced

{{self.__registry = conn.host}}

on line 57 of docker_hook.py with

{{self.__registry = conn.host if conn.port is None else 
f"\{conn.host}:\{conn.port}"}}

 

 

 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to