potiuk commented on a change in pull request #6266: [AIRFLOW-2439] Production 
Docker image support including refactoring of build scripts - depends on 
[AIRFLOW-5704]
URL: https://github.com/apache/airflow/pull/6266#discussion_r337393115
 
 

 ##########
 File path: Dockerfile
 ##########
 @@ -77,252 +75,300 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | 
bash - \
            libssl-dev \
            locales  \
            netcat \
-           nodejs \
            rsync \
            sasl2-bin \
            sudo \
+           libmariadb-dev-compat \
     && apt-get autoremove -yqq --purge \
     && apt-get clean \
     && rm -rf /var/lib/apt/lists/*
 
-# Install graphviz - needed to build docs with diagrams
-RUN apt-get update \
-    && apt-get install -y --no-install-recommends \
-           graphviz \
-    && apt-get autoremove -yqq --purge \
-    && apt-get clean \
-    && rm -rf /var/lib/apt/lists/*
-
-# Install MySQL client from Oracle repositories (Debian installs mariadb)
-RUN KEY="A4A9406876FCBD3C456770C88C718D3B5072E1F5" \
-    && GNUPGHOME="$(mktemp -d)" \
-    && export GNUPGHOME \
-    && for KEYSERVER in $(shuf -e \
-            ha.pool.sks-keyservers.net \
-            hkp://p80.pool.sks-keyservers.net:80 \
-            keyserver.ubuntu.com \
-            hkp://keyserver.ubuntu.com:80 \
-            pgp.mit.edu) ; do \
-          gpg --keyserver "${KEYSERVER}" --recv-keys "${KEY}" && break || true 
; \
-       done \
-    && gpg --export "${KEY}" | apt-key add - \
-    && gpgconf --kill all \
-    rm -rf "${GNUPGHOME}"; \
-    apt-key list > /dev/null \
-    && echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-5.6" | tee -a 
/etc/apt/sources.list.d/mysql.list \
-    && apt-get update \
-    && apt-get install --no-install-recommends -y \
-        libmysqlclient-dev \
-        mysql-client \
-    && apt-get autoremove -yqq --purge \
-    && apt-get clean && rm -rf /var/lib/apt/lists/*
-
 RUN adduser airflow \
     && echo "airflow ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/airflow \
     && chmod 0440 /etc/sudoers.d/airflow
 
 
############################################################################################################
-# This is an image with all APT dependencies needed by CI. It is built on top 
of the airlfow APT image
-# Parameters:
-#     airflow-apt-deps - this is the base image for CI deps image.
+# CI airflow image
 
############################################################################################################
-FROM airflow-apt-deps-ci-slim as airflow-apt-deps-ci
+FROM airflow-base as airflow-ci
 
 SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
 
-ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
+# Setting to 1 speeds up building the image. Cassandra driver without CYTHON 
saves around 10 minutes
+# But might not be suitable for production image
+ENV CASS_DRIVER_NO_CYTHON="1"
+ENV CASS_DRIVER_BUILD_CONCURRENCY=8
+
+ENV JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/
+
+# By changing the CI build epoch we can force reinstalling apt dependenecies 
for CI
+# It can also be overwritten manually by setting the build variable.
+ARG CI_APT_DEPENDENCIES_EPOCH_NUMBER="1"
+ENV CI_APT_DEPENDENCIES_EPOCH_NUMBER=${CI_APT_DEPENDENCIES_EPOCH_NUMBER}
+
+RUN apt-get update \
+    && apt-get install --no-install-recommends -y \
+         apt-transport-https ca-certificates wget dirmngr gnupg 
software-properties-common curl gnupg2 \
+    && export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 \
+    && curl -sL https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public 
| apt-key add - \
+    && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
 
 Review comment:
   I checked it and it makes more sense to use the recommended setup method for 
NPM: https://tecadmin.net/install-latest-nodejs-npm-on-debian/  -> installing 
it this way provides latest LTS release including newer version of npm (node: 
10.16.3. npm 6.9.0 comparing to node 10.15.2, npm 5.8.0 with standard debian 
buster packages). 
   
   Also when you install nodejs/npm using standard buster packages, you get to 
install a lot more (you need to install both npm and nodejs,  and install npm 
downloads a looooot of extra packages). 
   
   `The following NEW packages will be installed:
     gyp javascript-common libjs-inherits libjs-is-typedarray libnode-dev 
libuv1-dev node-abbrev node-ajv node-ansi node-ansi-align node-ansi-regex 
node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet 
node-asn1 node-assert-plus node-asynckit
     node-aws-sign2 node-aws4 node-balanced-match node-bcrypt-pbkdf 
node-bluebird node-boxen node-brace-expansion node-builtin-modules 
node-builtins node-cacache node-call-limit node-camelcase node-caseless 
node-chalk node-chownr node-cli-boxes node-cliui node-clone
     node-co node-color-convert node-color-name node-combined-stream 
node-concat-map node-concat-stream node-config-chain 
node-console-control-strings node-copy-concurrently node-core-util-is 
node-cross-spawn node-cyclist node-dashdash node-decamelize
     node-decompress-response node-deep-extend node-defaults 
node-delayed-stream node-delegates node-detect-indent node-detect-newline 
node-duplexer3 node-duplexify node-ecc-jsbn node-editor node-encoding 
node-end-of-stream node-errno node-escape-string-regexp node-execa
     node-extend node-extsprintf node-find-up node-flush-write-stream 
node-forever-agent node-form-data node-from2 node-fs-vacuum 
node-fs-write-stream-atomic node-fs.realpath node-gauge node-get-caller-file 
node-get-stream node-getpass node-glob node-got node-graceful-fs
     node-gyp node-har-schema node-har-validator node-has-flag 
node-has-symbol-support-x node-has-to-string-tag-x node-has-unicode 
node-hosted-git-info node-http-signature node-iconv-lite node-iferr 
node-import-lazy node-imurmurhash node-inflight node-inherits node-ini
     node-invert-kv node-is-builtin-module node-is-npm node-is-object 
node-is-plain-obj node-is-retry-allowed node-is-stream node-is-typedarray 
node-isarray node-isexe node-isstream node-isurl node-jsbn 
node-json-parse-better-errors node-json-schema
     node-json-stable-stringify node-json-stringify-safe node-jsonify 
node-jsonparse node-jsonstream node-jsprim node-latest-version 
node-lazy-property node-lcid node-libnpx node-locate-path node-lockfile 
node-lowercase-keys node-lru-cache node-mem node-mime-types
     node-mimic-fn node-mimic-response node-minimatch node-minimist 
node-mississippi node-mkdirp node-move-concurrently node-mute-stream 
node-node-uuid node-nopt node-normalize-package-data node-npm-package-arg 
node-npm-run-path node-npmlog node-oauth-sign
     node-object-assign node-once node-opener node-os-locale node-osenv 
node-p-cancelable node-p-finally node-p-limit node-p-locate node-p-timeout 
node-package-json node-parallel-transform node-path-exists 
node-path-is-absolute node-path-is-inside node-performance-now
     node-prepend-http node-process-nextick-args node-promise-inflight 
node-promzard node-proto-list node-prr node-pump node-pumpify node-punycode 
node-qs node-qw node-rc node-read node-read-package-json node-readable-stream 
node-registry-auth-token node-registry-url
     node-request node-require-directory node-require-main-filename 
node-resolve-from node-retry node-rimraf node-run-queue node-safe-buffer 
node-semver node-semver-diff node-set-blocking node-sha node-shebang-command 
node-shebang-regex node-signal-exit node-slash
     node-slide node-sorted-object node-spdx-correct node-spdx-expression-parse 
node-spdx-license-ids node-sshpk node-ssri node-stream-each node-stream-iterate 
node-stream-shift node-string-decoder node-string-width node-strip-ansi 
node-strip-eof node-strip-json-comments
     node-supports-color node-tar node-term-size node-text-table node-through 
node-through2 node-timed-out node-tough-cookie node-tunnel-agent node-tweetnacl 
node-typedarray node-uid-number node-unique-filename node-unpipe 
node-url-parse-lax node-url-to-options
     node-util-deprecate node-uuid node-validate-npm-package-license 
node-validate-npm-package-name node-verror node-wcwidth.js node-which 
node-which-module node-wide-align node-widest-line node-wrap-ansi node-wrappy 
node-write-file-atomic node-xdg-basedir node-xtend
     node-y18n node-yallist node-yargs node-yargs-parser npm 
python-pkg-resources`

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


With regards,
Apache Git Services

Reply via email to