Skip to content

Commit cab466d

Browse files
authored
[BRE-943] Harden base image with alpine (#365)
## 🎟️ Tracking [[BRE-943]](https://bitwarden.atlassian.net/jira/software/projects/BRE/boards/144?jql=assignee%20%3D%20712020%3Aac9853d4-55a2-4808-acad-e7b7914eac07&selectedIssue=BRE-943) ## 📔 Objective As part of ongoing work to harden Docker images, using "better" method to update to alpine ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes [BRE-943]: https://bitwarden.atlassian.net/browse/BRE-943?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 2f777cd commit cab466d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/memory-testing/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
###############################################
22
# Build stage #
33
###############################################
4-
FROM rust:1.85 AS base
4+
FROM rust:1.85-alpine AS base
55
WORKDIR /app
66

77
# Make sure the correct rust toolchain is installed only once
88
COPY rust-toolchain.toml /app/
99
RUN rustup show
1010

11+
# Install build dependencies for Alpine
12+
RUN apk add --no-cache build-base linux-headers musl-dev libc-dev
13+
1114
# Install cargo-chef, to cache dependency builds
1215
RUN cargo install cargo-chef --version 0.1.71 --locked
1316

@@ -28,12 +31,12 @@ RUN cargo build -p memory-testing --release
2831
###############################################
2932
# App stage #
3033
###############################################
31-
FROM debian:bookworm-slim
34+
FROM alpine:3.22
3235

3336
# This specifically needs to run as root to be able to capture core dumps
3437
USER root
3538

36-
RUN apt-get update && apt-get install -y --no-install-recommends gdb=13.1-3 && apt-get clean && rm -rf /var/lib/apt/lists/*
39+
RUN apk add --no-cache gdb=15.2-r0
3740

3841
# Copy built project from the build stage and the cases.json file
3942
COPY --from=build /app/target/release/memory-testing /app/target/release/capture-dumps ./

0 commit comments

Comments
 (0)