在Docker容器上安装Redis

时间:2020-08-06 04:30:44

标签: docker redis

我试图在我的node.js应用程序容器中安装Redis。

容器抛出以下错误:

    StringBuilder sb = new StringBuilder(txtBody.Text);

    int chatId="123456789"; //not real Chat ID


    // Buttons
    InlineKeyboardButton urlButton1 = new InlineKeyboardButton();
    InlineKeyboardButton urlButton2 = new InlineKeyboardButton();
    InlineKeyboardButton urlButton3 = new InlineKeyboardButton();

    urlButton1.Text = "Go URL1";
    urlButton1.Url = "https://www.google.com/";

    urlButton2.Text = "Go URL2";
    urlButton2.Url = "https://www.bing.com/";

    urlButton3.Text = "Go URL3";
    urlButton3.Url = "https://www.yahoo.com/";

    InlineKeyboardButton[] buttons = new InlineKeyboardButton[] { urlButton1, urlButton2 , urlButton3};
    InlineKeyboardMarkup inline = new InlineKeyboardMarkup(buttons);

    // Send message!
    bot.SendTextMessageAsync(chatId, sb.ToString(), ParseMode.Html, true, false, 0, inline);

我在Dockerfile中尝试过Starting redis-server: Starting nginx: nginx. /etc/init.d/redis-server: 58: ulimit: error setting limit (Operation not permitted). ,但没有帮助。

下面是我的Dockerfile。

chmod 777 /etc/init.d/redis-server

1 个答案:

答案 0 :(得分:0)

该问题可能是因为在节点基础映像中使用的用户不是root用户。 尝试将用户更改为root。

更好的方法是将2个容器分开