diff --git a/Dockerfile b/Dockerfile index 40fd29a..4c88f9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,60 @@ FROM ubuntu:18.04 +# simulate keyboard input during install wizard +# y: use master branch +# n: automatically update on Mycroft launch +# y: add helper commands to PATH +# n: check code style when submitting +ARG WIZARD_SEQUENCE=ynyn + ENV TERM linux ENV DEBIAN_FRONTEND noninteractive - -# Install Server Dependencies for Mycroft -RUN set -x \ - && sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \ - && apt-get update \ - && apt-get -y install git python3 python3-pip locales sudo \ - && pip3 install future msm \ - # Checkout Mycroft - && git clone https://github.com/MycroftAI/mycroft-core.git /opt/mycroft \ - && cd /opt/mycroft \ - && mkdir /opt/mycroft/skills \ - # git fetch && git checkout dev && \ this branch is now merged to master - && CI=true /opt/mycroft/./dev_setup.sh --allow-root -sm \ - && mkdir /opt/mycroft/scripts/logs \ - && touch /opt/mycroft/scripts/logs/mycroft-bus.log \ - && touch /opt/mycroft/scripts/logs/mycroft-voice.log \ - && touch /opt/mycroft/scripts/logs/mycroft-skills.log \ - && touch /opt/mycroft/scripts/logs/mycroft-audio.log \ - && apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN curl https://forslund.github.io/mycroft-desktop-repo/mycroft-desktop.gpg.key | apt-key add - 2> /dev/null && \ - echo "deb http://forslund.github.io/mycroft-desktop-repo bionic main" > /etc/apt/sources.list.d/mycroft-desktop.list -RUN apt-get update && apt-get install -y mimic +RUN set -x + +# Install system packages required by Mycroft +RUN apt-get update \ + && sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \ + && apt-get -y install sudo locales curl git python3 python3-pip \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN curl https://forslund.github.io/mycroft-desktop-repo/mycroft-desktop.gpg.key | apt-key add - 2> /dev/null +RUN echo "deb http://forslund.github.io/mycroft-desktop-repo bionic main" > /etc/apt/sources.list.d/mycroft-desktop.list +RUN apt-get update \ + && apt-get -y install mimic \ + && apt-get clean + +# Install python packages +RUN pip3 install future msm # Set the locale RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 - -WORKDIR /opt/mycroft -COPY startup.sh /opt/mycroft ENV PYTHONPATH $PYTHONPATH:/mycroft/ai -RUN echo "PATH=$PATH:/opt/mycroft/bin" >> $HOME/.bashrc \ - && echo "source /opt/mycroft/.venv/bin/activate" >> $HOME/.bashrc - -RUN chmod +x /opt/mycroft/start-mycroft.sh \ - && chmod +x /opt/mycroft/startup.sh +# Clone and checkout Mycroft repository +WORKDIR /opt/mycroft +RUN git clone https://github.com/MycroftAI/mycroft-core.git . + +# Install using wizard +# ynyn: see WIZARD_SEQUENCE build-arg +# -sm: skip building mimic locally +# --allow-root: +RUN echo $WIZARD_SEQUENCE | ./dev_setup.sh --allow-root -sm +RUN mkdir scripts/logs +RUN touch scripts/logs/mycroft-bus.log +RUN touch scripts/logs/mycroft-voice.log +RUN touch scripts/logs/mycroft-skills.log +RUN touch scripts/logs/mycroft-audio.log +COPY startup.sh . +RUN chmod +x ./startup.sh + +RUN echo -e "\ + PATH=$PATH:/opt/mycroft/bin \n\ + source /opt/mycroft/.venv/bin/activate \n\ +" >> $HOME/.bashrc EXPOSE 8181