在docker文件中的Tee命令

问题描述 投票:0回答:1

我正在尝试使用dockerfile下面安装rethinkdb

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"
        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

好像源列表没有正确写入。任何帮助,将不胜感激。提前致谢。

docker rethinkdb
1个回答
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"
© www.soinside.com 2019 - 2024. All rights reserved.