Running as root without -no-sandbox is not supported. I found these by trying to start the app, getting an error like In particular, node:14 is missing a bunch of libraries that Electron depends on for rendering the display. The base images are typically pretty stripped down compared to a normal OS installation. yq -no-install-suggests -no-install-recommends \ & apt-get clean & rm -rf /var/lib/apt/lists/*
DOCKER ON MAC TUTORIAL INSTALL
RUN apt-get update & apt-get install \ git libx11-xcb1 libxcb-dri3-0 libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2 \ (I picked node:14 because the smaller ones sounded from the docs like they might not work for me, but I should go back and try it.)įrom this point on in the Dockerfile you can run ordinary shell commands in the context of the guest: # stuff needed to get Electron to run There are a bunch of choices here: for example, the sample app in the tutorial uses an image with Node on top of Alpine Linux, which is a lot smaller than Debian. This one is a Debian image with Node.js version 14 installed (see ). Docker has a repository of images of various base operating systems and add-ons. This line names a base image to start with. Here's the one I wrote (with explanations interpolated): FROM node:14 To build an image, you write a Dockerfile, which is a script of actions that modify the guest computer's storage when the script finishes, the storage is snapshotted into a file on the host. Set things up so that the app running on the guest can display a window on my Mac. (To run a guest computer you load an image into a container. I went through the getting started tutorial, it was great.īuild an image containing the base Linux installation and any extra libraries needed to run my app. Here is what I needed to do at a high level:
![docker on mac tutorial docker on mac tutorial](https://maclife.vn/wp-content/uploads/2020/02/cDock-mac.png)
Mostly why this was complicated is that Programmable Matter is based on Electron, which makes some unusual demands of the operating system it runs on.
![docker on mac tutorial docker on mac tutorial](https://cdn.wccftech.com/wp-content/uploads/2020/01/dock-magnifcation-effect-macOS-768x597.png)
Nonetheless I ran into a lot of puzzling stuff and did a whole lot of Googling to get it working.
![docker on mac tutorial docker on mac tutorial](https://dz2cdn1.dzone.com/storage/temp/12484168-dock02.png)
I have a vague idea how this all works but I still find it extremely magical! Docker seems to be very well put together and everything worked really smoothly for me.
DOCKER ON MAC TUTORIAL SOFTWARE
You can use it to develop and test software on other OSes (or different versions of your host OS) or to bundle up a bunch of software packages so users can install and uninstall them all together or to run programs in a restricted environment so they can't damage the host. I had not used Docker before so this was an adventure! I learned a lot.ĭocker lets you run virtual computers (I'll call them guests, although this is not official Docker terminology ) inside your computer (the host ), and guests can run different operating systems from the one the host runs. So the past few days I have been getting it running on Linux on Docker in order to fix it. My co-Recurser Hazem tried running Programmable Matter on Linux, and it didn't work very well (I had previously run it only on my Mac).
DOCKER ON MAC TUTORIAL HOW TO
Jake Donham > Technical Difficulties > How to run Electron on Linux on Docker on Mac How to run Electron on Linux on Docker on Mac