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 alpine as base for Docker image #1021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

midzelis
Copy link

@midzelis midzelis commented Jun 1, 2023

Alpine based images are 35mb while debian:bullseye-20230502-slim is 135mb.

Docker-compose could use postgres:14-alpine for another reduction in size.

Also added UID/GID to the docker-compose. This is a best practice. Otherwise the container will run with whatever user is running docker, which could be root. The Dockerfile was also modified to run with a user/group of 1000/1000 which also seems to be a common practice. (Ideally, the perms would be fixed as part of the entrypoint/cwd at runtime as well, to match the env vars, but I didn't do that)

@vercel
Copy link

vercel bot commented Jun 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2023 1:13pm
atuin-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2023 1:13pm

Copy link
Sponsor

@Sierra1011 Sierra1011 left a comment

Choose a reason for hiding this comment

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

UID and GUID changes would be great, especially for running in Kubernetes with securityContext values.

# Install ca-certificates for webhooks to work
RUN apt update && apt install ca-certificates -y && rm -rf /var/lib/apt/lists/*
WORKDIR app
FROM alpine:3.12 as runner
Copy link
Sponsor

Choose a reason for hiding this comment

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

Using 3.18 would be a good up-to-date version with plenty of space left in the lifecycle.

@ellie
Copy link
Member

ellie commented Feb 26, 2024

Hey! Would it be possible to make the UID/GID changes separately please?

I'm unlikely to want to change to alpine any time soon. Historically, there have been issues with the musl allocator performing poorly in multi-threaded environments. I wouldn't say not to building an alpine image in addition however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants