The `bin/verify-exercises-in-docker` script

I hit a slight snag when updating this file on the Scheme track. The script creates a temporary directory on the local file system:

tmp_dir=$(mktemp -d -t "exercism-verify-${slug}-XXXXX")

then mounts this in Docker.:

   --mount type=tmpfs,dst=/tmp \

There is an implicit assumption about where the tmp directory is located. This works (on Ubuntu-related OS’s) if Docker is installed from the apt repository, but not if installed from Snap - which does weird and silly things when creating tmp directories.

For my immediate purposes, I could get it working by putting the tmp directory under the repository root:

tmp_dir=$(mktemp -d -p "${PWD}" "exercism-verify-${slug}-XXXXX")

Alternatively, we could put it under ~/.

When reviewing, @BNAndras asked if this fix should be applied upstream to the generic-track. Thoughts?

So snap-installed docker can’t even see your local /tmp ??

My first reaction is to treat this as a bug in that docker, and I would tell you to install docker via apt.

I’m getting dis-inclined to add little fixes for (IMO) user environment problems.

1 Like

I have a lot of sympathy with your dis-inclination.

It’s just unfortunate that Canonical are pushing Snap so hard. Even on my Linux Mint installation, Snap frequently has more up-to-date versions (of many things) than apt.

I’ll switch to a non-Snap Docker, and stop messing with the generic track.

I thought this creates a new tmp volume without access to your system FS.

1 Like

I have never had any problems using Homebrew on Linux, and it has the same benefit.

1 Like

Docker likely has their own apt repository as well if the official apt channels for your distro are out-of-date.

If there is an explicit /tmp mount point, couldn’t you just use mktemp -p /tmp?

Yes, that’s what I installed earlier today. I’ll keep trying to move away from Snap, and its odd approach to filesystems.