-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile-build_cache
109 lines (71 loc) · 2.17 KB
/
dockerfile-build_cache
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
FROM --platform=$TARGETPLATFORM python:3.11-bookworm as wheelbuild
ARG CI_JOB_TOKEN
ARG CI_API_V4_URL
ARG CI_PROJECT_ID
ENV LC_ALL en_US.UTF-8
ENV PATH /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin::~/.cargo/bin
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg-reconfigure debconf -f noninteractive
RUN apt update
# SoF fixing dpkg ldconfig not found error
# Download Binary
RUN cd /tmp \
&& apt-get download \
libc-bin
RUN ls -la
# Extract Binary
RUN cd /tmp; \
dpkg --extract $(ls | grep libc-bin_ | grep -a '.deb') /tmp/deb; ls -laR
# # Extracted?
# RUN ls -laR
# Copy to home location
RUN cp /tmp/deb/sbin/ldconfig /sbin/
# Confirm present
RUN ls -l /sbin/ldconfig
# Confirm can be found
RUN which ldconfig
# Cleanup
# RUN rm -Rf /tmp/deb \
# && rm libc-bin_*.deb
# Should re-install without issue
RUN apt-get install -y --reinstall \
libc-bin
# EoF fixing dpkg ldconfig not found error
# Set Locale to en_US as ansible requires a locale for it to function without chucking a tantrum!!
RUN apt install -yq \
build-essential \
cargo \
curl \
git \
libffi-dev \
libpq-dev \
libssl-dev \
mariadb-client \
mariadb-client-core \
openssh-client \
pkg-config \
postgresql-client \
postgresql-common \
python3-dev \
rustc
RUN rustc --version \
&& cargo --version
RUN pip install --upgrade pip
RUN pip install --upgrade \
setuptools \
wheel \
setuptools-rust \
twine
COPY requirements.txt /tmp/requirements.txt
RUN mkdir -p /tmp/python_modules /tmp/python_builds
RUN cd /tmp/python_modules \
&& pip download --dest . --check-build-dependencies \
-r /tmp/requirements.txt
RUN cd /tmp/python_modules \
# && export PATH=$PATH:~/.cargo/bin \
&& echo "[DEBUG] PATH=$PATH" \
&& pip wheel --wheel-dir /tmp/python_builds --find-links . *.whl; \
pip wheel --wheel-dir /tmp/python_builds --find-links . *.tar.gz;
RUN cd /tmp; \
ls -laR
RUN TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --skip-existing --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi /tmp/python_builds/*