-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdockerfile
50 lines (38 loc) · 1.01 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
ARG PYTHON_VERSION="3.12"
ARG ROOT_CONTAINER=python:${PYTHON_VERSION}-slim-bullseye
FROM ${ROOT_CONTAINER} AS binaries
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
WORKDIR /tmp
ENV DEBIAN_FRONTEND noninteractive
ENV FREETDS /etc/freetds
COPY freetds.conf /etc/freetds/
RUN \
apt-get -qq update --yes && \
apt-get -qq upgrade --yes && \
apt-get -qq install --yes --no-install-recommends \
build-essential \
freetds-dev \
git \
libssl-dev \
libyaml-dev \
tini \
> /dev/null && \
apt-get -qq clean && \
rm -rf /var/lib/apt/lists/* && \
pip install -U pip setuptools wheel
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
FROM binaries AS source
COPY . .
FROM source AS pre-commit
RUN \
pip install ".[dev]"
CMD pre-commit run --all-files
FROM source AS test
RUN \
pip install ".[dev]"
CMD pytest
FROM source AS build-wheel
CMD pip wheel --no-deps -w ./dist .
FROM binaries AS install-wheel
CMD pip install --find-links=./dist dsdk[dev]