GOSU cmd fails within Circleci build


#1

Trying to build the basic Postgresql 9.6 container, which includes the following:

grab gosu for easy step-down from root

ENV GOSU_VERSION 1.10
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget
RUN rm -rf /var/lib/apt/lists/*
RUN wget -O /usr/local/bin/gosu “https://github.com/tianon/gosu/releases/download/GOSU_VERSION/gosu-(dpkg --print-architecture)”
RUN export GNUPGHOME="$(mktemp -d)"
RUN chmod +x /usr/local/bin/gosu
RUN gosu nobody true
RUN apt-get purge -y --auto-remove ca-certificates wget

The RUN gosu nobody true cmd (to test the gosu function is working) returns an error within the circle ci build.

Error:
Step 10/31 : RUN gosu nobody true
—> Running in d44f589c3057
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0xf0b54, 0x9)
/usr/local/go/src/runtime/panic.go:566 +0x80
runtime.newosproc(0x14420022000, 0x14420031fc0)
/usr/local/go/src/runtime/os_linux.go:160 +0x1e0
runtime.newm(0xfddb8, 0x0)
/usr/local/go/src/runtime/proc.go:1572 +0x144
runtime.main.func1()
/usr/local/go/src/runtime/proc.go:126 +0x2c
runtime.systemstack(0x162d00)
/usr/local/go/src/runtime/asm_arm64.s:237 +0x90
runtime.mstart()
/usr/local/go/src/runtime/proc.go:1079

goroutine 1 [running]:
runtime.systemstack_switch()
/usr/local/go/src/runtime/asm_arm64.s:186 +0x8 fp=0x1442001c760 sp=0x1442001c750
runtime.main()
/usr/local/go/src/runtime/proc.go:127 +0x5c fp=0x1442001c7b0 sp=0x1442001c760
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:983 +0x4 fp=0x1442001c7b0 sp=0x1442001c7b0
The command ‘/bin/sh -c gosu nobody true’ returned a non-zero code: 2


#2