Mycroft Community Forum

Mycroft and Docker images, a different approach

Hi community,

During the past few weeks I worked on building Docker images for Mycroft using a different approach, the micro-services one.

Basically each Mycroft services such as audio, skills, etc… will run into their own container with their own /shared volumes (when required).

The main differences with the official Mycroft images are:

  • Micro-service approach
  • No more skills “re-installation”
  • Automatic nightly build (dev only, until backports are applied to master) and pushed on Docker Hub
  • Multiple CPU architectures support
  • docker-compose support
  • GPIO support for Raspberry Pi
  • A container dedicated to the command line

It’s not perfect for sure but it fits my needs/requirements for the project I’m working on. Fill free to share your feedback and to contribute. :partying_face:

5 Likes

That looks awesome, looks like you’ve put a ton of work into it, and there are so many improvements on the current image.

1 Like

Amazing! Am going to play around with that immediately!

2 Likes

Yeah I had some fun evenings and I gained few more white hairs :rofl: I really enjoyed the learning of the buildx feature which allows the multi-arch support but overall I still be a Podman fan boy ^^

@mdverhoeven that would be great, I mostly tested the containers on ARM 64-bit so some surprises could happen! :crazy_face:

1 Like

Do you have any feedback to share, any bugs?
The PulseAudio part could be a bit tricky. :upside_down_face:

I applied XDG change from PR 2794. Images have been rebuild.

As far as I understood, the image assumes that there is a device that runs docker and requires audio and the microphone.
In my stack, we entirely rely on a Docker container in the cloud, i.e. there is no need for audio. Will this image work nicely in this setup too or is there even a configuration where I can exclude the audio?

Hi @ScienceGuy,

It depends I would say how you use Mycroft on the cloud but when creating the containers, it is not mandatory to pass the devices.

$ sudo docker run -d \
  -v ~/mycroft-config:/home/mycroft/.config/mycroft \
  -v ~/mycroft-web-cache:/var/tmp \
  -v mycroft_ipc:/tmp/mycroft/ipc \
  -v mycroft_skills:/opt/mycroft/skills \
  -v mycroft_skills_venv:/opt/mycroft-venv \
  -v mycroft_skills_repo:/opt/mycroft \
  -v ${XDG_RUNTIME_DIR}/pulse:${XDG_RUNTIME_DIR}/pulse \
  -v ~/.config/pulse/cookie:/home/mycroft/.config/pulse/cookie \
  -v /sys:/sys:ro \
  --device /dev/snd \
  --device /dev/gpiomem \ # For Raspberry Pi GPIO
  --group-add $(getent group audio | cut -d: -f3) \
  --group-add $(getent group gpio | cut -d: -f3) \ # For Raspberry Pi GPIO
  --env PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
  --env PULSE_COOKIE=/home/mycroft/.config/pulse/cookie \
  --network host \
  --name mycroft_skills \
  smartgic/mycroft-skills:dev

You could remove --device from the command and/or remove the pulseaudio part.