Docker image maintainer - missing?

Hi TW community!

I can see that a most popular and up-to-date docker image by elasticdog is outdated.

I can see some forks of his repository, but no published docker images.

Does it mean there is a void / vacancy for person to build these docker images?
Or does the community just uses a different (say, base nodejs) image?

I’m asking as I might help! :wave:

Marcin

3 Likes

Hi @marcinkoziej
Welcome to the community.

I think it would be nice to have a flexible docker image that can be built automatically. IMO the TW app should be in a “throw away” container, but the data should be persistent.

Just some thoughts.
Mario

2 Likes

This is the dockerfile I wrote before, which is slightly different from other tiddlywiki images. Anyone can try to build the latest image locally.

This docker image supports this. It mounts the file directory locally through file directory mapping, rather than inside docker.

1 Like

That’s a nice start, but I was thinking about a more conservative approach.

  • Starting from an LTS Node.js version eg: lts-alpine3.18
  • only using, what’s installed by the Node.js maintainers
    • node, npm, yarn
    • corepack is marked as “experimental” and is intended to be used to manage “package manager”. A TW docker image does not need more than 1 package manager
    • imo pnpm … imo not needed, since npm is already part of the image.
  • for “production” - after installation is done - IMO npm and yarn should be removed
  • a “development” version can keep npm and yarn.
  • Mapping to the local harddrive is OK for development
  • IMO for “production” the persistent storage should be mapped to a docker volume for speed reasons.
  • The whole thing should work with linux, Mac and Windows (Docker for Windows)

just some thoughts.
-m

2 Likes

I don’t use Docker myself, but it is very popular, and I think it would be highly desirable to get one (or more) standard, core Docker images into the main repo.

3 Likes

It would be nice to provide sufficient information / recommendations so such docker images can be hosted locally, internet facing and on services available to host online.

1 Like

indeed, something like this topic - Run Tiddlywiki (node) in Docker with Tailscale

as of course many people are running their TW on Synology or similar in LAN and then using whatever variant of Wireguard to connect to it via the internetz

Looks like Nicola’s image is indeed the most up-to-date one

I use an alpine container with node and tiddlywiki installed, but I would prefer to switch to an official versioned docker container from the TiddlyWiki project.

1 Like

I’m not familiar enough with Docker to do it myself, but I believe that adding a Docker build to our existing CI framework would be straightforward for someone with the relevant skills and experience. I would welcome the contribution of a CI update to achieve this.

1 Like

Docker is a standalone app. I have used it on linux where is must be run with root privileges. I use it to sanbox the install and running of npm packages.

What is the use case for an official tw image?

I was responding to the discussion around GitHub - elasticdog/tiddlywiki-docker: Tools for running TiddlyWiki via a Docker container where there was an expression of interest in an official equivalent.

The use case for an official image is the same as the use case for an tiddlywiki saver or web clipper – even if its the same saver or web clipper solution – people feel more comfortable with one-stop solutions than 3rd party solutions. The scavenger hunt approach to everything does not breed confidence in the project. Having a sanctioned solution helps funnel more people and support to that solution.

If you’re talking about the use-case for a docker solution in particular, then arguably not having to worry about NVM, NPM, and node eases some of the headache of the node.js installation. In my case, I combined it with tailscale so I can feel relatively confident of running it as a server inside it’s own network.

For those who aren’t familiar, the general workflow for using a docker solution is

  1. Install Docker, of course
  2. Download 1 or two text files (typically docker-compose.yml and .env)
  3. Configure variables in the file for your setup to specify things like ports or where your tiddlers live
  4. Give a command: docker compose up -d

Your app is now running, and you can access it typically using whatever server port you specified. Yes, you can digress in ten different directions, but that’s a pretty common way to use it. Depending on your compose file, updating can be as simple as bringing your instance down and then back up again.

Docker communicates with the world through either ports, sockets, or file directories, limiting the attack surface.

Everything lives in the Docker container, meaning the solution is easy to upgrade and easy to port to a different machine. In theory that other machine could be on a completely different o/s and architecture.

I guess a really good special edition for tiddlywiki would bundle tiddlywiki with caddy so people could easily use it as a server and have the SSL taken care of.

1 Like

I don’t see any benefit to running a tw, on its own, in a docker image. tw does not have any npm dependencies, and so does not need sandboxing from third party packages. Your use case is obviously valid.

To have an official tw docker image, I think it would have to be signed, and there would probably be the need for a official docker account for tiddlywiki.

But is it worth the effort?
It is easy to create a dockerfile.

Some time ago I published on Github the Dockerfile to build a Tiddlyserver image (GitHub - mauloop/tiddlyserver-docker). It is still working and uses by default the latest Tiddlywiki version, unless you change the npm install directive (instructions are provided in the Readme). Tiddlyserver (TiddlyServer · Boosting TiddlyWiki into orbit) is a convenient way to run multiple Tiddlywiki node.js based instances, still working even tough it looks to be no longer mantained. Hope this can help.

1 Like

Given that the image I’m using has a half million downloads, someone must think it’s worthwhile.

Maybe the word “official” is too strong. Maybe “sanctioned” or “recommended”.

1 Like

It would be interesting to know what it is being used for. An official docker image would help people avoid downloading dodgy images…

1 Like

I run Tiddlywiki in a container using Podman’s Quadlets feature on Linux: podman-systemd.unit — Podman documentation

This allows me to manage my Tiddlywiki like any other systemd service (eg, start at login) and doesn’t require me to install any additional software on my computer. It also does not require root/admin access or any additional user privileges.

In my case, I have mounted a local filesystem folder for the wiki storage and I’m using my own image based on alpine which is basically a thin wrapper over npm install then tiddlywiki --listen

I doubt this is a common use-case for Tiddlywiki containers but I’m happily using it on multiple machines, and I would switch to an official image if one were available.

2 Likes

here is a simplistic use case

  • you have bought Synology NAS which can run containers to host your home lab services
  • in Synology there is its own Container Manager which many people would try to use (it is very basic)
  • official image would provide more or less tested way to get it up and running (and get updates)
  • see how many options come up if you search in there

I still think this is an example worth trying