当前,我将dotfiles(在.bashrc中引用)复制到/root 有没有更好的方法来组织他们?
FROM alpine:latest LABEL maintainer="Michael Durrant<junk@snap2web.com>" RUN apk add bash git vim COPY alpine_bashrc /root/.bashrc COPY .bash_functions.sh /root COPY .bash_aliases /root COPY .git-completion.bash /root RUN "/bin/bash"
COPY 对于每个文件,建议改为使用目录。限制是文件必须按容器中显示的名称命名。
COPY
$ ls . Dockerfile dotfiles/ .bashrc .git-completion.bash .bash_functions.sh .bash_aliases.sh
... COPY dotfiles/ root/
每一个 复制 指令在容器中创建新层。通过使用一个指令节省空间/时间。
复制