dockerfile
FROM nginx
ARG TSET="test0001"
RUN echo "xxxx$TSET"
RUN echo '你好' > text.txt && cat text.txt
RUN /bin/bash -c echo 'echo hello of dockerfile'
build
docker build .
可以看到仅仅输出了命令,但没有输出log。
因为它显示的输出来自 buildkit,它替代了 docker 附带的经典构建引擎.您可以使用 —progress 选项调整输出:
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
#添加 --progress=plain 将显示未从缓存加载的运行命令的输出.
DOCKER_BUILDKIT
如果不想使用 buildkit,可以通过在 shell 中导出 DOCKER_BUILDKIT=0 来恢复到旧的构建引擎,例如
DOCKER_BUILDKIT=0 docker build .
或
export DOCKER_BUILDKIT=0
docker build .