Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

curquiza
Copy link
Member

Fixes #3504

@curquiza curquiza added the tooling Not directly project related, like Docker, Homebrew... label Feb 20, 2023
@curquiza curquiza added this to the v1.1.0 milestone Feb 20, 2023
FROM rust:alpine3.16 AS compiler

RUN apk add -q --update-cache --no-cache build-base openssl-dev
FROM rust:bullseye AS compiler
Copy link
Member Author

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
Copy link
Member Author

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?

@github-actions
Copy link

github-actions bot commented Feb 20, 2023

Uffizzi Ephemeral Environment deployment-17241

☁️ https://app.uffizzi.com/github.com/meilisearch/meilisearch/pull/3516

📄 View Application Logs etc.

The meilisearch preview environment contains a web terminal from where you can run the
meilisearch command. You should be able to access this instance of meilisearch running in
the preview from the link Meilisearch Endpoint link given below.

Web Terminal Endpoint :
Meilisearch Endpoint : /meilisearch

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
export JEMALLOC_SYS_WITH_LG_PAGE=16; \
fi && \
cargo build --release

# Run
FROM alpine:3.16
FROM debian:11.6

Choose a reason for hiding this comment

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

Suggested change
FROM debian:11.6
FROM debian:11.6-slim

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

@curquiza curquiza removed this from the v1.1.0 milestone Feb 23, 2023
curquiza and others added 2 commits February 23, 2023 17:39
Co-authored-by: Markus Machatschek <markus.machatschek@hey.com>
Co-authored-by: Markus Machatschek <markus.machatschek@hey.com>
Comment on lines +26 to +29
RUN set -ex; \
apt-get update -q; \
apt-get install -q -y --no-install-recommends tini; \
rm -rf /var/lib/apt/lists/*
Copy link
Contributor

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.

Suggested change
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/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Not directly project related, like Docker, Homebrew...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ubuntu/debian instead of alpine in Docker image
3 participants