How do I make a comment in a Dockerfile?

前端 未结 7 1077
悲&欢浪女
悲&欢浪女 2021-01-29 20:21

I am writing a Dockerfile. Is there a way to make comments in this file?

Does Docker have a comment option that takes the rest of a line and ignores it?

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 20:48

    Use the # syntax for comments

    From: https://docs.docker.com/engine/reference/builder/#format

    # My comment here
    RUN echo 'we are running some cool things'
    

提交回复
热议问题