forked from acdha/pre-commit-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1013 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (26 loc) · 1013 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
FROM "debian:bookworm"
ARG apt_proxy
USER root
# apt sources
COPY debian.sources /etc/apt/sources.list.d/debian.sources
# apt proxy
RUN test -n "$apt_proxy" && echo "Acquire::http { Proxy \"$apt_proxy\"; };" >/etc/apt/apt.conf.d/31proxy || :
# install deb list
COPY deb-list.txt /tmp/deb-list.txt
RUN apt-get update && \
cat /tmp/deb-list.txt | DEBIAN_FRONTEND="noninteractive" xargs \
apt-get install -y --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*
# install pre-commit
RUN PIPX_HOME=/usr/local/pipx PIPX_BIN_DIR=/usr/local/bin pipx install pre-commit
# Allow this repository's configuration to serve as a default which can be
# overwritten by the target repo:
WORKDIR /tmp/build
COPY .pre-commit-config.yaml .
RUN git init && pre-commit install-hooks && rm -rf /tmp/build
RUN git config --global --add safe.directory /code
COPY --chmod=755 run-pre-commit /usr/local/bin
VOLUME /code
WORKDIR /code
ENTRYPOINT ["/usr/local/bin/run-pre-commit"]