Run as a non-root user in Docker
Open
enhancement
- Dominant language
- Go
- Stars
- 29.3k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the solution you'd like**
It is better not to run as root in Docker containers where it is not needed, for security reasons. Currently, the Docker image runs as root by default:
```
docker run --rm --entrypoint whoami zricethezav/gitleaks:v8.30.1@sha256:c00b6bd0aeb3071cbcb79009cb16a60dd9e0a7c60e2be9ab65d25e6bc8abbb7f
root
```
cc @zricethezav
Contributor guide
Research direction
Start by locating the Docker image build definition for zricethezav/gitleaks:v8.30.1 and check how its default runtime user is set. Verify the image with the reported docker run --entrypoint whoami command, confirm it no longer reports root, and ensure the CLI still runs as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100