-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1016 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# syntax=docker/dockerfile:1
# Docker image with RbFly preinstalled.
#
# - The same image with uv preinstalled is used as base.
# - GCC (build-essential) is required to build RbFly.
#
# ARG directives apply to a layer, that is why they need to be repeated.
# - PYTHON_VER (default: 3.12)
# - RBFLY_VER
# build stage
ARG PYTHON_VER
FROM ghcr.io/astral-sh/uv:python${PYTHON_VER:-3.12}-bookworm-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
ARG RBFLY_VER
WORKDIR /app
RUN uv pip install --system rbfly==${RBFLY_VER}
# RUN uv venv && uv pip install rbfly
# compile final image
ARG PYTHON_VER
FROM ghcr.io/astral-sh/uv:python${PYTHON_VER:-3.12}-bookworm-slim
ARG RBFLY_VER
ARG PYTHON_VER
ARG DIR="/usr/local/lib/python${PYTHON_VER:-3.12}/site-packages/rbfly"
COPY --from=builder ${DIR} ${DIR}
COPY --from=builder ${DIR}-${RBFLY_VER}.dist-info ${DIR}-${RBFLY_VER}.dist-info
COPY --from=builder /app /app
# reset entrypoint from parent
ENTRYPOINT []
CMD ["bash"]