You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/11 16:46:16 UTC

[GitHub] potiuk commented on a change in pull request #4483: [AIRFLOW-3673] Add official dockerfile

potiuk commented on a change in pull request #4483: [AIRFLOW-3673] Add official dockerfile
URL: https://github.com/apache/airflow/pull/4483#discussion_r247181729
 
 

 ##########
 File path: .travis.yml
 ##########
 @@ -37,13 +37,19 @@ env:
 stages:
   - flake8
   - test
+  - docker-push
 
 jobs:
   include:
     - stage: flake8
       name: Flake8
       script: docker-compose --log-level ERROR -f scripts/ci/docker-compose.yml run airflow-testing /app/scripts/ci/run-ci.sh
       env: TOX_ENV=flake8
+    - name: docker-push
+      # require the branch name to be master (note for PRs this is the base branch name)
+      if: branch = master
+      script: docker build -t apache/airflow:master -t apache/airflow:$TRAVIS_COMMIT . && docker push apache/airflow:$TRAVIS_COMMIT && docker push apache/airflow:master
 
 Review comment:
   You will have to use `docker pull` followed by `docker build --cache-from` in order to utilise docker caching. The problem is that when you start builds on a fresh machine the layers are different from what was built on another machine and effectively you do not reuse previously built layers - i.e. the image is re-build and all layers are pushed every time you make push.
   
   There is relatively new --cache-from feature of docker which works in the way that when you pull the image built elsewhere you can use it as source of cache for subsequent builds. This means that you will only incrementally built final layers  only if for example just sources or just setup.py changes.
   
   You can read more about it in this issue : https://stackoverflow.com/questions/37440705/how-to-setup-docker-to-use-cache-from-registry-on-every-build-step (see the second answer - highest voted)

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


With regards,
Apache Git Services