【发布时间】:2021-10-23 00:00:29
【问题描述】:
我有一个 Dockerfile
FROM strimzi/kafka:0.20.1-kafka-2.6.0
USER root:root
RUN mkdir -p /opt/kafka/plugins/debezium
# Download, unpack, and place the debezium-connector-postgres folder into the /opt/kafka/plugins/debezium directory
RUN curl -s https://repo1.maven.org/maven2/io/debezium/debezium-connector-postgres/1.7.0.Final/debezium-connector-postgres-1.7.0.Final-plugin.tar.gz | tar xvz --transform 's/debezium-connector-postgres/debezium/' --directory /opt/kafka/plugins/
USER 1001
当我在上面使用hadolint时
hadolint Dockerfile
我收到警告
Dockerfile:6 DL4006 警告:在 RUN 之前设置 SHELL 选项 -o pipefail,其中包含管道。如果您在 alpine 映像中使用 /bin/sh,或者如果您的 shell 符号链接到 busybox,那么请考虑将您的 SHELL 显式设置为 /bin/ash,或者禁用此检查
我知道我在以RUN 开头的行中有一个管道|。
但是,根据这个警告,我仍然真的不知道如何解决。
【问题讨论】:
标签: dockerfile lint hadolint