-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use Debian instead of Alpine in Dockerfile #3516
base: main
Are you sure you want to change the base?
Conversation
FROM rust:alpine3.16 AS compiler | ||
|
||
RUN apk add -q --update-cache --no-cache build-base openssl-dev | ||
FROM rust:bullseye AS compiler |
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.
Unfortunately I cannot select a docker image from Rust with a pinned version of Debian
Let me know if I'm wrong: https://hub.docker.com/_/rust
export JEMALLOC_SYS_WITH_LG_PAGE=16; \ | ||
fi && \ | ||
cargo build --release | ||
|
||
# Run | ||
FROM alpine:3.16 | ||
FROM debian:11.6 |
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.
Should we use the same version of debian as the compiler, even if it's not a pinned version?
Uffizzi Ephemeral Environment
|
export JEMALLOC_SYS_WITH_LG_PAGE=16; \ | ||
fi && \ | ||
cargo build --release | ||
|
||
# Run | ||
FROM alpine:3.16 | ||
FROM debian:11.6 |
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.
FROM debian:11.6 | |
FROM debian:11.6-slim |
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.
this will trim the image by at least 20MB
Co-authored-by: Markus Machatschek <markus.machatschek@hey.com>
Co-authored-by: Markus Machatschek <markus.machatschek@hey.com>
RUN set -ex; \ | ||
apt-get update -q; \ | ||
apt-get install -q -y --no-install-recommends tini; \ | ||
rm -rf /var/lib/apt/lists/* |
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.
I haven't run a build here to check actual numbers, but adding an apt-get clean
in addition to the rm -rf /var/lib/apt/lists/*
should reduce the image size some more.
RUN set -ex; \ | |
apt-get update -q; \ | |
apt-get install -q -y --no-install-recommends tini; \ | |
rm -rf /var/lib/apt/lists/* | |
RUN set -ex; \ | |
apt-get update -q; \ | |
apt-get install -q -y --no-install-recommends tini; \ | |
apt-get clean; \ | |
rm -rf /var/lib/apt/lists/* |
Fixes #3504