Build with:
docker build . -t userdrop
Run with:
docker run --rm --cap-drop=all userdrop
- Binary build with CGO enabled by leveraging static musl that comes default in alpine containers
- Added ca-certificates package to a well-known path and then copied into scratch container for Go to load
- Added a basic passwd file to drop to a non-root user
- Run with all capabilities dropped
- For image size with an added initial memory footprint and boot-up time, packed the statically built executable with UPX
docker inspect userdrop -f '{{.Size}}'
2250956
docker run --rm --cap-drop=all userdrop
Google returned a '200' status code.
Called into C function!
Running as: nobody