我是Docker(2周)的新手,但我正在爲Meteor安裝編寫Dockerfile取得良好進展。在Docker中安裝Meteor時出現文件許可錯誤
現在我看到文件權限錯誤的最後一行。老實說,我認爲更廣泛的問題是我沒有完全理解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
任何指針,你可以給我提高我的問題根源的理解將不勝感激。
可以使用梅特基地圖像 https://github.com/jshimko/meteor-launchpad –
你可以建議什麼是錯與上面的Dockerfile? – timebandit
你能鏈接完整的Dockerfile嗎?除了多個RUN而不是隻有一個&&我看不出有什麼大的錯誤 –