在使用Dockerfile构建镜像时,ENTRYPOINT和CMD都可以作为容器启动时的命令,下面是两个DockerFile
FROM ubuntu:22.04
ENTRYPOINT ["echo", "Hello"]
CMD ["World", "ChatGPT"]
CMD ["123", "ABC"]
输出:Hello 123 ABC
FROM ubuntu:22.04
ENTRYPOINT ["echo", "Hello"]
CMD ["World", "ChatGPT"]
输出:Hello World ChatGPT
标签:CMD,echo,ENTRYPOINT,World,ChatGPT,dockerfile,Hello
From: https://www.cnblogs.com/whtjyt/p/17466635.html