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.

11 lines
427 B
Docker

# 注释: Dockerfile RUN指令
FROM busybox
WORKDIR /app
RUN /bin/sh -c 'echo 我是shell方式执行后写入的内容 > demo.txt'
RUN ["/bin/sh", "-c", "echo exec方式执行后写入的内容 > demo2.txt"]
# docker build --rm -f Dockerfile.Run -t study:buildrun1 .
# docker run --rm -it --name runstudy1 study:buildrun1
# pwd 查看当前目录
# ls 命令查看是否有demo.txt demo2.txt文件
# cat demo.txt 查看内容