![]() :type host_tmp_dir: str :param network_mode: Network mode for the container. If not provided defaults to using the standard system temp directory. :type mem_limit: float or str :param host_tmp_dir: Specify the location of the temporary directory on the host which will be mapped to tmp_dir. Either a float value, which represents the limit in bytes, or a string like ``128m`` or ``1g``. :type force_pull: bool :param mem_limit: Maximum amount of memory the container can use. (templated) :type environment: dict :param force_pull: Pull the docker image on every run. Default is unix://var/run/docker.sock :type docker_url: str :param environment: Environment variables to set in the container. See :type cpus: float :param dns: Docker custom DNS servers :type dns: list :param dns_search: Docker custom DNS search domain :type dns_search: list :param docker_url: URL of the host running the docker daemon. Optional (templated) :type container_name: str or None :param cpus: Number of CPUs to assign to the container. (templated) :type command: str or list :param container_name: Name of the container. :type auto_remove: bool :param command: Command to be run in the container. :type api_version: str :param auto_remove: Auto-removal of the container on daemon side when the container's process exits. Set to ``auto`` to automatically detect the server's version. :type image: str :param api_version: Remote API version. If image tag is omitted, "latest" will be used. :param image: Docker image from which to create the container. If a login to a private registry is required prior to pulling the image, a Docker connection needs to be configured in Airflow and the connection ID be provided with the parameter ``docker_conn_id``. The path to the mounted directory can be accessed via the environment variable ``AIRFLOW_TMP_DIR``. A temporary directory is created on the host and mounted into a container to allow storing files that together exceed the default disk size of 10GB in a container. class DockerOperator ( BaseOperator ): """ Execute a command inside a docker container. """ Implements Docker operator """ import ast import six from docker import APIClient, tls from _hook import DockerHook from airflow.exceptions import AirflowException from airflow.models import BaseOperator from import apply_defaults from import TemporaryDirectory See the License for the # specific language governing permissions and limitations # under the License. You may obtain a copy of the License at # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. ![]() The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License") you may not use this file except in compliance # with the License. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |