forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
137 lines (125 loc) · 3.7 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ARG PY_3_11=3.11.4
ARG PY_3_10=3.10.12
ARG PY_3_9=3.9.17
ARG PY_3_8=3.8.17
ARG PY_3_7=3.7.17
ARG PYENV_VERSION=v2.3.19
FROM ghcr.io/dependabot/dependabot-updater-core as python-core
ARG PY_3_11
ARG PY_3_10
ARG PY_3_9
ARG PY_3_8
ARG PY_3_7
ARG PYENV_VERSION
USER root
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
dirmngr \
zlib1g-dev \
liblzma-dev \
libgdbm-dev \
bison \
tzdata \
zip \
openssh-client \
build-essential \
make \
libpq-dev \
libssl-dev \
libbz2-dev \
libffi-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-openssl-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
libmysqlclient-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libgeos-dev \
python3-enchant
COPY --chown=dependabot:dependabot python/helpers /opt/python/helpers
USER root
ENV PYENV_ROOT=/usr/local/.pyenv \
PATH="/usr/local/.pyenv/bin:$PATH"
RUN mkdir -p "$PYENV_ROOT" && chown dependabot:dependabot "$PYENV_ROOT"
USER dependabot
ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt"
RUN git -c advice.detachedHead=false clone https://github.com/pyenv/pyenv.git --branch $PYENV_VERSION --single-branch --depth=1 /usr/local/.pyenv
FROM python-core as python-3.10
RUN pyenv install $PY_3_10 \
&& bash /opt/python/helpers/build_for_version $PY_3_10 \
&& cd /usr/local/.pyenv \
&& tar czf 3.10.tar.gz versions/$PY_3_10
FROM python-core as python-3.9
RUN pyenv install $PY_3_9 \
&& bash /opt/python/helpers/build_for_version $PY_3_9 \
&& cd /usr/local/.pyenv \
&& tar czf 3.9.tar.gz versions/$PY_3_9
FROM python-core as python-3.8
RUN pyenv install $PY_3_8 \
&& bash /opt/python/helpers/build_for_version $PY_3_8 \
&& cd /usr/local/.pyenv \
&& tar czf 3.8.tar.gz versions/$PY_3_8
FROM python-core as python-3.7
RUN pyenv install $PY_3_7 \
&& bash /opt/python/helpers/build_for_version $PY_3_7 \
&& cd /usr/local/.pyenv \
&& tar czf 3.7.tar.gz versions/$PY_3_7
FROM ghcr.io/dependabot/dependabot-updater-core
ARG PY_3_11
ARG PYENV_VERSION
USER root
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
dirmngr \
zlib1g-dev \
liblzma-dev \
libgdbm-dev \
bison \
tzdata \
zip \
openssh-client \
build-essential \
make \
libpq-dev \
libssl-dev \
libbz2-dev \
libffi-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-openssl-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
libmysqlclient-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libgeos-dev \
python3-enchant
### PYTHON
COPY --chown=dependabot:dependabot python/helpers /opt/python/helpers
USER root
ENV PYENV_ROOT=/usr/local/.pyenv \
PATH="/usr/local/.pyenv/bin:$PATH"
RUN mkdir -p "$PYENV_ROOT" && chown dependabot:dependabot "$PYENV_ROOT"
USER dependabot
ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt"
RUN git -c advice.detachedHead=false clone https://github.com/pyenv/pyenv.git --branch $PYENV_VERSION --single-branch --depth=1 /usr/local/.pyenv
RUN pyenv install $PY_3_11 \
&& pyenv global $PY_3_11 \
&& bash /opt/python/helpers/build_for_version $PY_3_11
COPY --from=python-3.10 /usr/local/.pyenv/3.10.tar.gz /usr/local/.pyenv/3.10.tar.gz
COPY --from=python-3.9 /usr/local/.pyenv/3.9.tar.gz /usr/local/.pyenv/3.9.tar.gz
COPY --from=python-3.8 /usr/local/.pyenv/3.8.tar.gz /usr/local/.pyenv/3.8.tar.gz
COPY --from=python-3.7 /usr/local/.pyenv/3.7.tar.gz /usr/local/.pyenv/3.7.tar.gz
COPY --chown=dependabot:dependabot python $DEPENDABOT_HOME/python
COPY --chown=dependabot:dependabot common $DEPENDABOT_HOME/common
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater