@@ -53,6 +53,10 @@ class DockerOperator(BaseOperator):
53
53
This value gets multiplied with 1024. See
54
54
https://docs.docker.com/engine/reference/run/#cpu-share-constraint
55
55
:type cpus: float
56
+ :param dns: Docker custom DNS servers
57
+ :type dns: list of strings
58
+ :param dns_search: Docker custom DNS search domain
59
+ :type dns_search: list of strings
56
60
:param docker_url: URL of the host running the docker daemon.
57
61
Default is unix://var/run/docker.sock
58
62
:type docker_url: str
@@ -127,13 +131,17 @@ def __init__(
127
131
xcom_push = False ,
128
132
xcom_all = False ,
129
133
docker_conn_id = None ,
134
+ dns = None ,
135
+ dns_search = None ,
130
136
* args ,
131
137
** kwargs ):
132
138
133
139
super (DockerOperator , self ).__init__ (* args , ** kwargs )
134
140
self .api_version = api_version
135
141
self .command = command
136
142
self .cpus = cpus
143
+ self .dns = dns
144
+ self .dns_search = dns_search
137
145
self .docker_url = docker_url
138
146
self .environment = environment or {}
139
147
self .force_pull = force_pull
@@ -203,7 +211,9 @@ def execute(self, context):
203
211
host_config = self .cli .create_host_config (
204
212
binds = self .volumes ,
205
213
network_mode = self .network_mode ,
206
- shm_size = self .shm_size ),
214
+ shm_size = self .shm_size ,
215
+ dns = self .dns ,
216
+ dns_search = self .dns_search ),
207
217
image = image ,
208
218
mem_limit = self .mem_limit ,
209
219
user = self .user ,
0 commit comments