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 2021/04/28 13:25:28 UTC
[GitHub] [airflow] potiuk opened a new pull request #15573: Upgrade hadolint to version 2.3.0
potiuk opened a new pull request #15573:
URL: https://github.com/apache/airflow/pull/15573
Newer versions of hadolint hint about more Docker problems:
* consecutive RUN operation
* invalid labels
This PR fixes all the problems reported in our dockerfiles
by the latest hadolint and refreshes all our images used in CI
and chart so that corrected label names are included (one of
the errors in all our dockerfiles turned out to be camel-case
and - in label keys, which is not valid according to
Docker label key specification.
Fixes: #15544
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
--
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:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622317281
##########
File path: chart/dockerfiles/pgbouncer/Dockerfile
##########
@@ -30,15 +30,16 @@ RUN apk --no-cache add make pkgconfig build-base libtool wget gcc g++ libevent-d
# We are not using Dash so we can safely ignore the "Dash warning"
# "In dash, something is not supported." https://github.com/koalaman/shellcheck/wiki/SC2169
# hadolint ignore=SC2169
-RUN wget "https://github.com/pgbouncer/pgbouncer/releases/download/pgbouncer_${PGBOUNCER_VERSION//\./_}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz"
-RUN echo "${PGBOUNCER_SHA256} pgbouncer-${PGBOUNCER_VERSION}.tar.gz" | sha256sum -c -
-RUN tar -xzvf pgbouncer-$PGBOUNCER_VERSION.tar.gz
+RUN wget --progress=dot:giga "https://github.com/pgbouncer/pgbouncer/releases/download/pgbouncer_${PGBOUNCER_VERSION//\./_}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz" \
+ && echo "${PGBOUNCER_SHA256} pgbouncer-${PGBOUNCER_VERSION}.tar.gz" | sha256sum -c - \
+ && tar -xzvf pgbouncer-$PGBOUNCER_VERSION.tar.gz
+
WORKDIR /pgbouncer-$PGBOUNCER_VERSION
-RUN ./configure --prefix=/usr --disable-debug && make && make install
-RUN mkdir /etc/pgbouncer
-RUN cp ./etc/pgbouncer.ini /etc/pgbouncer/
-RUN touch /etc/pgbouncer/userlist.txt
-RUN sed -i -e "s|logfile = |#logfile = |" \
+RUN ./configure --prefix=/usr --disable-debug && make && make install \
+ && mkdir /etc/pgbouncer \
+ && cp ./etc/pgbouncer.ini /etc/pgbouncer/ \
+ && touch /etc/pgbouncer/userlist.txt \
+ && sed -i -e "s|logfile = |#logfile = |" \
Review comment:
```suggestion
&& mkdir /etc/pgbouncer \
&& cp ./etc/pgbouncer.ini /etc/pgbouncer/ \
&& touch /etc/pgbouncer/userlist.txt \
&& sed -i -e "s|logfile = |#logfile = |" \
```
--
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:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622246312
##########
File path: chart/dockerfiles/pgbouncer/Dockerfile
##########
@@ -16,7 +16,7 @@
# under the License.
ARG ALPINE_VERSION="3.12"
FROM alpine:${ALPINE_VERSION} AS builder
-SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
+SHELL ["/bin/ash", "-e", "-x", "-c", "-o", "pipefail"]
Review comment:
Yep. https://en.wikipedia.org/wiki/Almquist_shell provided by busybox (in alpine image). Alpine has no bash. But hadolint suggest to use `ash` instead.
--
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:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622237583
##########
File path: chart/dockerfiles/pgbouncer/Dockerfile
##########
@@ -16,7 +16,7 @@
# under the License.
ARG ALPINE_VERSION="3.12"
FROM alpine:${ALPINE_VERSION} AS builder
-SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
+SHELL ["/bin/ash", "-e", "-x", "-c", "-o", "pipefail"]
Review comment:
Ash?
--
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:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622315918
##########
File path: Dockerfile
##########
@@ -191,9 +191,8 @@ ENV INSTALL_MYSQL_CLIENT=${INSTALL_MYSQL_CLIENT} \
# Only copy install_mysql.sh to not invalidate cache on other script changes
COPY scripts/docker/install_mysql.sh /scripts/docker/install_mysql.sh
-RUN bash ./scripts/docker/install_mysql.sh dev
-
-RUN mkdir -p /root/.local/bin
+RUN bash ./scripts/docker/install_mysql.sh dev && \
+ mkdir -p /root/.local/bin
Review comment:
Is it related to Python or MySQL? If Python, then we can move that to the 204 line.
--
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:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622317036
##########
File path: chart/dockerfiles/pgbouncer/Dockerfile
##########
@@ -30,15 +30,16 @@ RUN apk --no-cache add make pkgconfig build-base libtool wget gcc g++ libevent-d
# We are not using Dash so we can safely ignore the "Dash warning"
# "In dash, something is not supported." https://github.com/koalaman/shellcheck/wiki/SC2169
# hadolint ignore=SC2169
-RUN wget "https://github.com/pgbouncer/pgbouncer/releases/download/pgbouncer_${PGBOUNCER_VERSION//\./_}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz"
-RUN echo "${PGBOUNCER_SHA256} pgbouncer-${PGBOUNCER_VERSION}.tar.gz" | sha256sum -c -
-RUN tar -xzvf pgbouncer-$PGBOUNCER_VERSION.tar.gz
+RUN wget --progress=dot:giga "https://github.com/pgbouncer/pgbouncer/releases/download/pgbouncer_${PGBOUNCER_VERSION//\./_}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz" \
+ && echo "${PGBOUNCER_SHA256} pgbouncer-${PGBOUNCER_VERSION}.tar.gz" | sha256sum -c - \
+ && tar -xzvf pgbouncer-$PGBOUNCER_VERSION.tar.gz
Review comment:
```suggestion
&& echo "${PGBOUNCER_SHA256} pgbouncer-${PGBOUNCER_VERSION}.tar.gz" | sha256sum -c - \
&& tar -xzvf pgbouncer-$PGBOUNCER_VERSION.tar.gz
```
--
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:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622323385
##########
File path: Dockerfile
##########
@@ -191,9 +191,8 @@ ENV INSTALL_MYSQL_CLIENT=${INSTALL_MYSQL_CLIENT} \
# Only copy install_mysql.sh to not invalidate cache on other script changes
COPY scripts/docker/install_mysql.sh /scripts/docker/install_mysql.sh
-RUN bash ./scripts/docker/install_mysql.sh dev
-
-RUN mkdir -p /root/.local/bin
+RUN bash ./scripts/docker/install_mysql.sh dev && \
+ mkdir -p /root/.local/bin
Review comment:
Yep. might be better there.
--
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:
users@infra.apache.org
[GitHub] [airflow] potiuk merged pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #15573:
URL: https://github.com/apache/airflow/pull/15573
--
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:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#issuecomment-828565489
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.
--
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:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #15573: Upgrade hadolint to version 2.3.0
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #15573:
URL: https://github.com/apache/airflow/pull/15573#discussion_r622316340
##########
File path: Dockerfile.ci
##########
@@ -97,9 +97,8 @@ RUN mkdir -pv /usr/share/man/man1 \
# Only copy install_mysql.sh to not invalidate cache on other script changes
COPY scripts/docker/install_mysql.sh /scripts/docker/install_mysql.sh
-RUN bash /scripts/docker/install_mysql.sh dev
-
-RUN adduser airflow \
+RUN bash /scripts/docker/install_mysql.sh dev && \
+ adduser airflow \
Review comment:
```suggestion
RUN bash /scripts/docker/install_mysql.sh dev \
&& adduser airflow \
```
--
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:
users@infra.apache.org