Error trying to run Swift REPL

I followed the instructions to run a Swift REPL in docker:
$ docker run --cap-add sys_ptrace -it --rm swift swift

I get the following:
Unable to find image 'swift:latest' locally
latest: Pulling from library/swift
7b722c1070cd: Pull complete
5fbf74db61f1: Pull complete
ed41cb72e5c9: Pull complete
7ea47a67709e: Pull complete
391f9633b0ac: Pull complete
8b10bc3217d7: Pull complete
Digest: sha256:dd9004042a308eccdf1d6dc960b6ad3b3006c1062eb460d2e62001c35e21f518
Status: Downloaded newer image for swift:latest
error: failed to launch REPL process: process launch failed: 'A' packet returned an error: 8

I tried this on two version of macOS and Ubuntu 16.04 and get the same result.
Do I have something wrong or missing from the docker run command?

Thanks,
Chris

Are you following these instructions: Docker Hub?

You could try docker run --privileged -it --rm swift swift, which gives swift even more privileges.

Perhaps something changed recently that makes the REPL use more privileges. I think I remember that it has worked with just --cap-add sys_ptrace in the past.

1 Like

Thanks @marcrasi, that (docker run --privileged -it --rm swift swift) did the trick. Looks like the instructions at Docker Hub need to be updated.