Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

macOS Docker 25.1 构建镜像时不在输出 echo 等命令输出的调试信息?

Docker 的版本信息:??
image.png

构建日志:
image.png

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'
WORKDIR /app
RUN echo 'workdir after:' && pwd
#COPY /dist ./
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Centos 下 Docker 构建的日志是可以正常显示:
image

Centos 下的 Docker version
[root@development-server test]# docker version
Client: Docker Engine - Community
 Version:           19.03.11
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        42e35e61f3
 Built:             Mon Jun  1 09:13:48 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.11
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       42e35e61f3
  Built:            Mon Jun  1 09:12:26 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

这本身和docker没啥关系呀,你本身写法就有问题,

/bin/bash -c echo 'echo hello of dockerfile'

/bin/bash -c "cmd string"`中间多了一个echo

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...