-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (53 loc) · 1.96 KB
/
Copy pathDockerfile
File metadata and controls
68 lines (53 loc) · 1.96 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# The devcontainer should use the developer target and run as root with podman
# or docker with user namespaces.
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
# Add any system dependencies for the developer/build environment here
RUN apt-get update -y && apt-get install -y --no-install-recommends \
graphviz \
&& apt-get dist-clean
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libgl1 libegl1 -y
RUN apt-get update && apt-get install -y \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libegl1 \
libxcb-cursor0 -y
RUN apt-get update && apt-get install -y \
libxcb-icccm4 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xkb1 \
libxkbcommon-x11-0
RUN apt-get install fonts-noto-color-emoji -y
# The build stage installs the context into the venv
FROM developer AS build
# Change the working directory to the `app` directory
# and copy in the project
WORKDIR /app
COPY . /app
RUN chmod o+wrX .
# Tell uv sync to install python in a known location so we can copy it out later
ENV UV_PYTHON_INSTALL_DIR=/python
# Sync the project without its dev dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-editable --no-dev --managed-python
# The runtime stage copies the built venv into a runtime container
FROM ubuntu:resolute AS runtime
# Add apt-get system dependecies for runtime here if needed
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
# some-dependecies \
# && apt-get dist-clean
# Copy the python installation from the build stage
COPY --from=build /python /python
# Copy the environment, but not the source code
COPY --from=build /app/.venv /app/.venv
ENV PATH=/app/.venv/bin:$PATH
# change this entrypoint if it is not the same as the repo
ENTRYPOINT ["xrpd-toolbox"]
CMD ["--version"]
ENV MPLCONFIGDIR=/tmp/matplotlib
RUN export DISPLAY=:0