forked from fsfe/reuse-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-debian
43 lines (32 loc) · 1.1 KB
/
Dockerfile-debian
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
# SPDX-FileCopyrightText: 2021 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Create a base image that has dependencies installed.
FROM debian:12-slim AS base
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y --no-install-recommends install git mercurial python3 \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
# Build reuse into a virtualenv
FROM base AS build
RUN apt-get update \
&& apt-get -y --no-install-recommends install python3-venv python3-poetry python3-pip python3-wheel gettext \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /reuse-tool
COPY . /reuse-tool/
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN poetry install --no-interaction --no-root --only main
RUN poetry build --no-interaction
RUN pip install dist/*.whl
# Copy over the virtualenv and use it
FROM base
COPY --from=build /opt/venv /opt/venv
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN git config --global --add safe.directory /data
WORKDIR /data
ENTRYPOINT ["reuse"]
CMD ["lint"]