-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
50 lines (36 loc) · 1.21 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1
FROM ubuntu:latest as base
SHELL ["bash", "-l", "-c"]
ENV SHELL=/bin/bash
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&\
apt-get install -y curl git build-essential pkg-config gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev tk-dev uuid-dev zlib1g-dev &&\
apt-get clean
WORKDIR /tmp
COPY apt.txt /tmp/apt.txt
RUN xargs apt-get install -y <apt.txt
COPY --from=ghcr.io/astral-sh/uv:0.4.25 /uv /uvx /bin/
RUN useradd -G ubuntu dev
USER dev
WORKDIR /home/dev
# ===================================================================
FROM base as uv
ARG PYTHON_VERSION=3.11
USER dev
RUN uv python install $PYTHON_VERSION
# the pants installer puts things in ~/cache/nce and it needs to be persistent
RUN mkdir -p .cache && chown dev:dev .cache
VOLUME /home/dev/.cache
WORKDIR /home/dev/src
# ===================================================================
FROM uv as release
USER dev
WORKDIR /home/dev
RUN mkdir -m 0750 .ssh
COPY --chown=dev:dev . /home/dev/src
WORKDIR /home/dev/src
RUN uv sync