Mycroft AI
  • Documentation
  • About Mycroft AI
    • Why use Mycroft AI?
    • Glossary of terms
    • Contributing
    • FAQ
  • Using Mycroft AI
    • Get Mycroft
      • Mark II
        • Mark II Dev Kit
      • Mark 1
      • Picroft
      • Linux
      • Mac OS and Windows with VirtualBox
      • Docker
      • Android
    • Pairing Your Device
    • Basic Commands
    • Installing New Skills
    • Customizations
      • Configuration Manager
      • mycroft.conf
      • Languages
        • Français (French)
        • Deutsch (German)
      • Using a Custom Wake Word
      • Speech-To-Text
      • Text-To-Speech
    • Troubleshooting
      • General Troubleshooting
      • Audio Troubleshooting
      • Wake Word Troubleshooting
      • Log Files
      • Support Skill
      • Getting more support
  • Skill Development
    • Voice User Interface Design Guidelines
      • What can a Skill do?
      • Design Process
      • Voice Assistant Personas
      • Interactions
        • Intents
        • Statements and Prompts
        • Confirmations
      • Conversations
      • Error Handling
      • Example Interaction Script
      • Prototyping
      • Design to Development
    • Development Setup
      • Python Resources
      • Your First Skill
    • Skill Structure
      • Lifecycle Methods
      • Logging
      • Skill Settings
      • Dependencies
        • Manifest.yml
        • Requirements files
      • Filesystem access
      • Skill API
    • Integration Tests
      • Test Steps
      • Scenario Outlines
      • Test Runner
      • Reviewing the Report
      • Adding Custom Steps
      • Old Test System
    • User interaction
      • Intents
        • Padatious Intents
        • Adapt Intents
      • Statements
      • Prompts
      • Parsing Utterances
      • Confirmations
      • Conversational Context
      • Converse
    • Displaying information
      • GUI Framework
      • Show Simple Content
      • Mycroft-GUI on a PC
      • Mark 1 Display
    • Advanced Skill Types
      • Fallback Skill
      • Common Play Framework
      • Common Query Framework
      • Common IoT Framework
    • Mycroft Skills Manager
      • Troubleshooting
    • Marketplace Submission
      • Skills Acceptance Process
        • Information Review Template
        • Code Review Template
        • Functional Review Template
        • Combined Template
      • Skill README.md
    • FAQ
  • Mycroft Technologies
    • Technology Overview
    • Roadmap
    • Mycroft Core
      • MessageBus
      • Message Types
      • Services
        • Enclosure
        • Voice Service
        • Audio Service
        • Skills Service
      • Plugins
        • Audioservice Plugins
        • STT Plugins
        • TTS Plugins
        • Wake Word Plugins
      • Testing
      • Legacy Repo
    • Adapt
      • Adapt Examples
      • Adapt Tutorial
    • Lingua Franca
    • Mimic TTS
      • Mimic 3
      • Mimic 2
      • Mimic 1
      • Mimic Recording Studio
    • Mycroft GUI
      • Remote STT and TTS
    • Mycroft Skills Kit
    • Mycroft Skills Manager
    • Padatious
    • Precise
    • Platforms
Powered by GitBook
On this page
  • Prerequisites
  • Getting Started
  • Installing from Docker Hub
  • Installing via building the Docker image
  • Running Mycroft for Docker
  • Pairing Mycroft for Docker
  • Interacting With Mycroft on Docker
  • Accessing Mycroft Logs
  • CLI Access
  • Accessing Mycroft CLI
  • Installing Skills on Docker Mycroft
  • Removing Skills on Docker Mycroft
  • Troubleshooting
  • Text-to-speech not working
  • Getting help

Was this helpful?

  1. Using Mycroft AI
  2. Get Mycroft

Docker

Learn how to install Mycroft for Docker either from a Docker Hub install, or by building the image. Many thanks to Brian Hopkins (@btotharye) for this documentation.

PreviousMac OS and Windows with VirtualBoxNextAndroid

Last updated 2 years ago

Was this helpful?

Mycroft is available for Docker. You have two options for a Docker installation:

  • Build Image from source

  • Pull Image from Docker Hub

Prerequisites

This documentation assumes the following:

  • You have already installed Docker on your machine based on the operating system you are running.

Getting Started

Installing from Docker Hub

The Mycroft for Docker image is updated on and you can install it by running the command below:

docker pull mycroftai/docker-mycroft

Then follow the instructions below for running Mycroft for Docker.

Installing via building the Docker image

it pull this repository.

git clone https://github.com/MycroftAI/docker-mycroft.git

Build the Docker image in the directory that you have checked out.

docker build -t mycroft .

Follow the instructions for running Mycroft for Docker below to continue.

Running Mycroft for Docker

To prevent having to register your instance with home.mycroft.ai every time the container is started, and to have persistent data, you can map a local directory into the container. Just replace the directory_on_local_machine with the path you want the container mapped to on your local machine (eg. /home/user/mycroft).

Sounds can be played in the Docker container using pulseaudio, without modifying any config files

Run the following to start up Mycroft for Docker:

_NOTE: You don't need the -e PULSE_SERVER or any of the other pulse related variables if you only want to use text via a websocket to mycroft for example using this container.

docker run -d \  
-v directory_on_local_machine:/root/.mycroft \
--device /dev/snd \
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
-v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native \
-v ~/.config/pulse/cookie:/root/.config/pulse/cookie \
-p 8181:8181 \
--name mycroft mycroftai/docker-mycroft

Confirm via docker ps that your container is up and serving port 8181:

docker ps  
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES  
692219e23bf2 mycroft "/mycroft/ai/mycro..." 3 seconds ago Up 1 second 0.0.0.0:8181->8181/tcp mycroft

You should now have a running instance of Mycroft for Docker that you can interact with via the command line.

Pairing Mycroft for Docker

You can view the logs with:

docker logs -f mycroft

Interacting With Mycroft on Docker

Accessing Mycroft Logs

At any time you can watch the logs simply by running the bellow command:

docker logs -f mycroft

You can exit out of this docker log command by hitting Ctrl + C. The --follow turns it into a real tail instead of a cat of the log.

CLI Access

Accessing Mycroft CLI

You can interact with the CLI of the container by running the following command. This will connect you to the running container via bash:

docker exec -it mycroft /bin/bash

Once in the container you can do ./start-mycroft.sh cli to get a interactive CLI to interact with Mycroft for Docker if needed.

You can type Ctrl + C to exit the cli.

Installing Skills on Docker Mycroft

You can install Skills into the container by running the following:

docker exec -it mycroft /opt/mycroft/msm/msm install github_url

So to install the Hello World Skill:

docker exec -it mycroft /opt/mycroft/msm/msm install https://github.com/MycroftAI/skill-hello-world

Removing Skills on Docker Mycroft

You can also uninstall a Skill using MSM with:

docker exec -it mycroft /opt/mycroft/msm/msm remove skill-hello-world

Troubleshooting

Text-to-speech not working

There have been reports that mimic may not be properly added to the PATH. Restarting Mycroft within the Docker container can resolve this.

Getting help

Set env variable

Share pulseaudio's

After the container has been started you can watch the logs and look for the line that says "Pairing Code" and use this to pair at .

Mycroft for Docker is community-supported. You are welcome to join the .

dockerhub
PULSE_SERVER
cookie
https://home.mycroft.ai
Mycroft Chat Docker channel