​https://github.com/puckel/docker-airflow​

镜像介绍:https://hub.docker.com/r/puckel/docker-airflow/

docker pull puckel/docker-airflow 次镜像在docker hu上找到的
在里面安装vim和grpc
FROM        puckel/docker-airflow:1.8.1

MAINTAINER  zhangchunyang@goldwind.com

USER         0

RUN         apt-get update

RUN         apt-get install -y vim

RUN         pip install --upgrade pip

RUN         pip install grpcio

USER        airflow

  

docker run -d -p 32770:8080 -e LOAD_EX=n -e EXECUTOR=Local testair:0.0.3user 

v2=ti.xcom_pull(key="value2 from pusher 1", task_ids='print_the_context') key不存在的话,不报错,v2的只是None
haha=Variable.get("haha",default_var="not exist zcy") 若没有变量haha会报错,为了让他不报错,加上一个default_var即可
=========================

先把airflow起起来,到配置文件airflow.cfg中搜fernet_key,然后升级airflow,把fernet_key的值写入环境变量
==========================

$ python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> conn = sqlite3.connect('airflow.db')
>>> cursor = conn.cursor()
>>> cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
<sqlite3.Cursor object at 0x7f80a2ecc960>
>>> cursor.fetchall()
[(u'alembic_version',), (u'connection',), (u'dag',), (u'dag_pickle',), (u'import_error',), (u'job',), (u'known_event_type',), (u'log',), (u'sla_miss',), (u'slot_pool',), (u'users',), (u'variable',), (u'chart',), (u'known_event',), (u'xcom',), (u'dag_run',), (u'task_instance',), (u'task_fail',), (u'dag_stats',)]
>>>

=====================

查看安装的版本:

 

 

cursor.execute("select * from log")
cursor.execute("PRAGMA table_info(log)")
cursor.fetchall()