Skip to content

chore(Dockerfile): create a default non-root user - #5769

Merged
remyleone merged 1 commit into
mainfrom
dockerfile_user
Jul 1, 2026
Merged

chore(Dockerfile): create a default non-root user#5769
remyleone merged 1 commit into
mainfrom
dockerfile_user

Conversation

@remyleone

Copy link
Copy Markdown
Member

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:


Copilot AI review requested due to automatic review settings July 1, 2026 08:33
@codecov-commenter

codecov-commenter commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.10%. Comparing base (6e85e8b) to head (84b40a2).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5769      +/-   ##
==========================================
- Coverage   50.17%   50.10%   -0.08%     
==========================================
  Files         345      345              
  Lines       79418    79532     +114     
==========================================
  Hits        39846    39846              
- Misses      38070    38184     +114     
  Partials     1502     1502              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Creates and switches to a default non-root user in the runtime Docker image to improve container security posture.

Changes:

  • Add a scw user/group with fixed UID/GID (1000).
  • Change ownership of the scw binary and run the container as the non-root user.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
FROM alpine:3.23
WORKDIR /
RUN apk update && apk add --no-cache bash ca-certificates openssh-client && update-ca-certificates
RUN addgroup -g 1000 -S scw && adduser -u 1000 -S scw -G scw
Comment thread Dockerfile
RUN addgroup -g 1000 -S scw && adduser -u 1000 -S scw -G scw
COPY --from=builder /go/src/github.com/scaleway/scaleway-cli/scw .
RUN ln -s /scw /usr/local/bin/scw
RUN chown scw:scw /scw && ln -s /scw /usr/local/bin/scw
Comment thread Dockerfile
COPY --from=builder /go/src/github.com/scaleway/scaleway-cli/scw .
RUN ln -s /scw /usr/local/bin/scw
RUN chown scw:scw /scw && ln -s /scw /usr/local/bin/scw
USER scw
@remyleone
remyleone added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit eea5d2b Jul 1, 2026
124 checks passed
@remyleone
remyleone deleted the dockerfile_user branch July 1, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants