Skip to content

Instantly share code, notes, and snippets.

@marcan2020
Last active December 29, 2021 05:01
Show Gist options
  • Save marcan2020/87272ebcf5c8c28e58115b2e7242cdf4 to your computer and use it in GitHub Desktop.
Save marcan2020/87272ebcf5c8c28e58115b2e7242cdf4 to your computer and use it in GitHub Desktop.
Dockerized version of Notable with no network access

Notable in Docker with network access disabled

This is not perfect but it works. Useful repo: https://github.com/jessfraz/dockerfiles

Required files

Build

Dockerfile:

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
COPY ./notable_1.8.4_amd64.deb /opt/notable.deb
RUN cd /opt && apt-get install -y ./notable.deb
RUN cd /opt/Notable && chown root:root chrome-sandbox && chmod 4755 chrome-sandbox
RUN useradd -m -d /home/notable -u 999 notable
RUN chown -R notable:notable /home/notable
USER notable
ENV HOME=/home/notable
COPY ./.notable.json /home/notable/
CMD ["notable"]

Build command:

docker build -t notable .

Running

docker run \
   --rm \
   -h Docker \
   --net none \
   -v ~/notable/:/home/notable/notes \
   -v /tmp/.X11-unix:/tmp/.X11-unix \
   -e DISPLAY=unix$DISPLAY \
   --security-opt seccomp=chrome.json \
   --device /dev/dri \
   notable

Bugs

Gtk: cannot open display: :0

Potential fix:

xhost local:root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment