Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

FROM ${BASE_IMAGE}

COPY --from=deb /opt/tyk-gateway /opt/tyk-gateway
COPY --chown=65532:65532 --from=deb /opt/tyk-gateway /opt/tyk-gateway

Check warning on line 17 in ci/Dockerfile.distroless

View check run for this annotation

probelabs / Visor: quality

architecture Issue

The Dockerfile uses a hardcoded UID/GID `65532:65532`. This is a 'magic number' that reduces readability and maintainability. It is not immediately clear which user this corresponds to without prior knowledge (it's often 'nobody').
Raw output
To improve clarity and maintainability, define the UID and GID in `ARG` variables at the top of the Dockerfile and use these variables in the `COPY` instruction. This makes the configuration explicit and easier to manage. For example:

```Dockerfile
ARG NONROOT_UID=65532
ARG NONROOT_GID=65532

...

COPY --chown=${NONROOT_UID}:${NONROOT_GID} --from=deb /opt/tyk-gateway /opt/tyk-gateway
```

ARG PORTS
EXPOSE $PORTS
Expand Down
Loading