Skip to content

[DRAFT][DO NOT REVIEW] Add USER "app" to Dockerfile #3520

Draft
aaronburtle wants to merge 2 commits intomainfrom
dev/aaronburtle/Add-User-Docker-File
Draft

[DRAFT][DO NOT REVIEW] Add USER "app" to Dockerfile #3520
aaronburtle wants to merge 2 commits intomainfrom
dev/aaronburtle/Add-User-Docker-File

Conversation

@aaronburtle
Copy link
Copy Markdown
Contributor

@aaronburtle aaronburtle commented May 6, 2026

Why make this change?

Closes #3514

What is this change?

Adds a user app to our Dockerfile to avoid alterting scanners. For more information see: #3481

Switching from root to non-root could potentially be a breaking change so before this can be completed need to finalize the design decision raised in the associated issue. For more details, see: #3514

How was this tested?

Manually tested.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the container runtime stage to explicitly run Data API Builder as a non-root user (app) to satisfy container security scanners, aligning the Dockerfile with the base image’s intended default user.

Changes:

  • Add explanatory comments documenting the rationale for running as non-root in the final image stage.
  • Set USER app in the runtime stage so scanners see a non-root Config.User.

Comment thread Dockerfile
Comment on lines +20 to +24
# process and does not require root privileges. Declaring USER explicitly
# sets the image's Config.User field so image scanners (e.g. Checkmarx One)
# that require a non-root user in the final stage are satisfied.
# Port 5000 is above 1024 so a non-root user can bind to it without CAP_NET_BIND_SERVICE.
USER app
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

Copilot suggestion is valid.

@Aniruddh25 Aniruddh25 self-assigned this May 6, 2026
@aaronburtle aaronburtle self-assigned this May 7, 2026
@aaronburtle aaronburtle added cri Customer Reported issue docker labels May 7, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Review In Progress in Data API builder May 7, 2026
@aaronburtle aaronburtle added this to the May 2026 milestone May 7, 2026
@aaronburtle aaronburtle closed this May 7, 2026
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Data API builder May 7, 2026
@aaronburtle aaronburtle reopened this May 7, 2026
@github-project-automation github-project-automation Bot moved this from Done to Todo in Data API builder May 7, 2026
@aaronburtle aaronburtle marked this pull request as draft May 7, 2026 14:18
@aaronburtle aaronburtle changed the title Add USER "app" to Dockerfile [DRAFT][DO NOT REVIEW] Add USER "app" to Dockerfile May 7, 2026
@aaronburtle aaronburtle moved this from Todo to In Progress in Data API builder May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cri Customer Reported issue docker

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add USER to the Dockerfile

3 participants