You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
737 B
Docker

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 注释: ENTRYPOINT 入口指令
FROM ubuntu
# ENTRYPOINT ["top"]
# ENTRYPOINT ["top", "-b","-c"]
ENTRYPOINT ["top"]
CMD ["-c","-b"]
# 构建镜像
# docker build -f Dockerfile.ENTRYPOINT -t study.dockerfile.entrypoint:latest -t study.dockerfile.entrypoint:0.0.1 .
# docker run -it --rm study.dockerfile.entrypoint
# --entrypoint 覆盖 ENTRYPOINT指令
# docker run -it --rm --entrypoint="ls" study.dockerfile.entrypoint
# --entrypoint不能包含命令参数如下是错误的
# docker run -it --rm --entrypoint="top -b -c" study.dockerfile.entrypoint
# --entrypoint不能包含命令里的参数应该放在[COMMAND]位置,正确例子:
# docker run -it --rm --entrypoint="top" study.dockerfile.entrypoint -b -c