As @ibnesayeed mentionned, some environment variables are actually defined even in Scratch Docker images. `PATH` contains `/bin` so there is no need to overwrite it.
- Volume did not work properly as the config would be persistent but not shared across restart of the container running interactively.
- Docker run instructions were therefore updated and simplified to bind mount the config directory as volume do not really work in this situation.
- No need to build for amd64 architectures, just pull automatically from Docker Hub when invoking `docker run ...`
- Build instructions only for ARM devices as Docker Hub does not build for ARM architectures really.
- Updated Docker image tag from `lazydocker` to `lazyteam/lazydocker`
- Added docker-compose.yml collapsible example
- All the checks are in the `waitForTerminalSpace` function
- It tries to run the program directly if the width is positive
- It then sleeps 50 milliseconds the first time if the width is zero
- If after the first sleep, the terminal width is still zero, it prints the waiting time to stderr and will keep on doing so with increasing sleep times.
- Git commit is passed as a build argument as explained in README.md
- `.git` directory is ignored by Docker for a quicker build and smaller context
- the build arg VCS_REF is used both to tag the image and the Go program
- Runs the container with `/bin/sh` initially
- Invoke `lazydocker` from within the container, or gocui fails as the terminal window is invalid at launch
- Added .dockerignore to speed up build context and avoid rebuilding when unecessary
- Specified Alpine and Go versions as build arguments
- Specified Go target CPU architecture as build arguments to be able to build for ARM devices
- Specified base images as build arguments to be able to build for ARM devices
- Trimmed down size of final image using `-a -installsuffix cgo -ldflags="-s -w"` go build flags and by copying the statically built binary only to the final image
- Added clear build and run instructions for the Docker container