Skip to content

Instantly share code, notes, and snippets.

@smira
Last active February 27, 2020 18:25
Show Gist options
  • Save smira/0a6dbcfc6dd5b1b882dae61435b56f95 to your computer and use it in GitHub Desktop.
Save smira/0a6dbcfc6dd5b1b882dae61435b56f95 to your computer and use it in GitHub Desktop.
Workaround for Go 1.14 in Docker on Linux 5.3.0

Problem

While running Go 1.14 inside docker, you might hit error:

runtime: increase the mlock limit (ulimit -l)

Solution

Add the following to /etc/docker/daemon.json:

{
    //...
    "default-ulimits": {"memlock": {"Name": "memlock", "Hard": 67108864, "Soft": 67108864}}
}

Limit itself might depend on your system, default limit docker enforces is 65536, which is not enough for Go.

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