我正在尝试使用下面的dockerfile
安装rethinkdbRUN /bin/bash -c "source /etc/lsb-release" && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | tee "/etc/apt/sources.list.d/rethinkdb.list"
RUN wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
RUN sudo apt-get update
RUN sudo apt-get install rethinkdb
安装失败。下面是输出。
输出:
Step 22/23 : RUN sudo apt-get update
---> Running in 54d07239b6f3
E: Malformed entry 1 in list file /etc/apt/sources.list.d/rethinkdb.list (Component)
E: The list of sources could not be read.
The command '/bin/sh -c sudo apt-get update' returned a non-zero code: 100
似乎源列表编写不正确。 任何帮助,将不胜感激。 提前谢谢。
答案 0 :(得分:1)
您的source命令不会将变量从/ etc / lsb-release传输到echo命令。你需要这样的东西:
RUN /bin/bash -c 'source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main"' | tee "/etc/apt/sources.list.d/rethinkdb.list"