-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate python Dockerfiles for actual stable releases
- Loading branch information
vlaszdunov
committed
Jun 2, 2024
1 parent
91206fb
commit 4f18ed1
Showing
2 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM alpine as build | ||
|
||
RUN mkdir /usr/bin/ | ||
|
||
# install dependencies and python | ||
RUN apk add --no-cache \ | ||
build-base \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
bzip2-dev \ | ||
zlib-dev \ | ||
xz-dev \ | ||
readline-dev \ | ||
sqlite-dev \ | ||
wget \ | ||
&& cd /usr/src \ | ||
&& wget {python_link} \ | ||
&& tar xzf Python-{python_version}.tgz \ | ||
&& cd Python-{python_version} \ | ||
&& ./configure --enable-optimizations \ | ||
&& make altinstall \ | ||
&& ln -s /usr/local/bin/python{python_short_version} /usr/bin/python3 \ | ||
&& ln -s /usr/local/bin/pip{python_short_version} /usr/bin/pip3 \ | ||
&& apk del build-base \ | ||
&& rm -rf /usr/src/Python-{python_version}.tgz /usr/src/Python-{python_version} | ||
|
||
|
||
FROM scratch | ||
|
||
COPY --from=build / / | ||
|
||
WORKDIR /app | ||
|
||
CMD ["python3"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters