在Docker中安装Meteor时出现文件权限错误

时间:2017-06-20 12:27:14

标签: meteor docker dockerfile

我是Docker的新手(2周),但我在为Meteor安装编写Dockerfile方面取得了很好的进展。

现在我看到最后一行的文件权限错误。老实说,我认为更广泛的问题是我不完全理解Linux文件系统和权限;所以我会感激任何指示。

这是错误:

Meteor 1.5 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your 
convenience.
This may prompt for your password.
sudo: no tty present and no askpass program specified

Couldn't write the launcher script. Please either:

  (1) Run the following as root:
        cp "/home/.meteor/packages/meteor-tool/1.5.0/mt-
        os.linux.x86_64/scripts/admin/launch-meteor" /usr/bin/meteor
  (2) Add "$HOME/.meteor" to your path, or
  (3) Rerun this command to try again.

这是我运行的命令:

docker build --build-arg user_pass=user -t timebandit/meteor-1-5 --rm .

这是我认为是问题的Dockerfile部分:

FROM ubuntu:xenial

# update the system
RUN apt-get update && apt-get -y install curl \
    sudo \
    apt-utils \
    locales \
    nano

# Set the locale
RUN sudo sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    locale-gen
ENV LANG en_US.UTF-8  
ENV LANGUAGE en_US:en  
ENV LC_ALL en_US.UTF-8 

# set the root password
# RUN echo "root:root" | chpasswd

# create a user
RUN useradd -ms /bin/bash user
RUN adduser user sudo
RUN echo 'user:user' | chpasswd

ENV HOME=/home
WORKDIR $HOME
# WORKDIR $HOME/user

# allow writes to the home directory
USER root
RUN chmod 777 /home

# install meteor
# RUN echo $user_pass | curl https://install.meteor.com/ | sh
RUN curl https://install.meteor.com/ | sh
#docker build --build-arg user_pass=user -t timebandit/meteor-1-5 --rm .
ARG user_pass
USER user

非常感谢您提供的任何指示,以提高我对问题根源的理解。

1 个答案:

答案 0 :(得分:0)

看起来meteor安装脚本要求输入用户,因为你没有提供,构建步骤就失败了。

下面:
This may prompt for your password. sudo: no tty present and no askpass program specified