-
Notifications
You must be signed in to change notification settings - Fork 9
RED-181280 - support multiarch #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,27 @@ | ||||||||||||||||
| FROM python:3.8 | ||||||||||||||||
| FROM python:3.11-bookworm | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security control: Docker Scan Image User Should Not Be 'Root' Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile. Severity: HIGH Fix suggestion: This fix suggestion was generated by Jit. Please note that the suggestion might not always fit every use case. It is highly recommended that you check and review it before merging. Suggestion guidelines
Suggested change
Jit Bot commands and options (e.g., ignore issue)You can trigger Jit actions by commenting on this PR review:
|
||||||||||||||||
|
|
||||||||||||||||
| # Docker automatically provides TARGETARCH (amd64, arm64, etc.) for multi-platform builds | ||||||||||||||||
| ARG TARGETARCH | ||||||||||||||||
| ARG MEMTIER_VERSION=2.1.1 | ||||||||||||||||
|
|
||||||||||||||||
| ENV FLASK_APP app.py | ||||||||||||||||
| ENV APP_SETTINGS settings.cfg | ||||||||||||||||
| ENV NO_URL_QUOTING True | ||||||||||||||||
|
|
||||||||||||||||
| # Install memtier_benchmark from GitHub releases | ||||||||||||||||
| # Downloads the appropriate .deb file based on target architecture | ||||||||||||||||
| # Note: Version 2.1.1 is not available in the Redis APT repository, only on GitHub releases | ||||||||||||||||
| RUN curl -fsSL -o /tmp/memtier-benchmark.deb \ | ||||||||||||||||
| "https://github.com/RedisLabs/memtier_benchmark/releases/download/${MEMTIER_VERSION}/memtier-benchmark_${MEMTIER_VERSION}.bookworm_${TARGETARCH}.deb" && \ | ||||||||||||||||
| apt-get update && \ | ||||||||||||||||
| apt-get install -y --no-install-recommends /tmp/memtier-benchmark.deb && \ | ||||||||||||||||
| rm /tmp/memtier-benchmark.deb && \ | ||||||||||||||||
| rm -rf /var/lib/apt/lists/* && \ | ||||||||||||||||
| memtier_benchmark --version | ||||||||||||||||
|
|
||||||||||||||||
| COPY . /app | ||||||||||||||||
| WORKDIR /app | ||||||||||||||||
|
|
||||||||||||||||
| RUN pip install -r requirements.txt | ||||||||||||||||
|
|
||||||||||||||||
| RUN make memtier_benchmark | ||||||||||||||||
|
|
||||||||||||||||
| CMD python -m flask run -p 8080 -h 0.0.0.0 | ||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security control: Docker Scan
Image User Should Not Be 'Root'
Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.
Severity: HIGH
Learn more about this issue
Fix suggestion:
This fix suggestion was generated by Jit. Please note that the suggestion might not always fit every use case. It is highly recommended that you check and review it before merging.
Suggestion guidelines
docker run <image> whoami. If it returnsroot, then you should consider using a non-root user, by following one of the next steps:USERcommand to the Dockerfile, with a non-root user as argument, for example:USER <non-root-user-name>.Jit Bot commands and options (e.g., ignore issue)
You can trigger Jit actions by commenting on this PR review:
#jit_ignore_fpIgnore and mark this specific single instance of finding as “False Positive”#jit_ignore_acceptIgnore and mark this specific single instance of finding as “Accept Risk”#jit_ignore_type_in_fileIgnore any finding of type "Image user should not be 'root'" in Dockerfile; future occurrences will also be ignored.#jit_undo_ignoreUndo ignore command