Skip to content

Commit

Permalink
添加python
Browse files Browse the repository at this point in the history
  • Loading branch information
sijinhui committed Nov 15, 2023
1 parent 2a76394 commit 30d9793
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/logstash.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push Docker image
name: build logstash

on:
push:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build python

on:
push:
branches:
- main
paths:
- 'python/**'
jobs:
deploy:
name: 打包并上传python
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v5
with:
context: ./logstash
file: ./logstash/Dockerfile
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/python:3.9.18-alpine
38 changes: 38 additions & 0 deletions python/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM python:3.9.18-alpine

MAINTAINER sijinhui
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update && apk add vim
RUN apk add --no-cache \
bash \
make \
curl \
libstdc++ \
&& apk add --no-cache \
--virtual .build-deps \
gcc \
musl-dev \
linux-headers \
g++ \
make \
libxslt-dev \
python3-dev \
libc-dev \
libressl-dev \
libffi-dev \
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir pandas \
&& apk --purge del .build-deps \
&& find / -type f -iname \*.pyc -delete \
&& find / -type f -iname \*.pyo -delete \
&& find / -type f -iname __pycache__ -delete \

RUN apk add tzdata \
apk add --virtual .build-deps build-base python3-dev libffi-dev openssl-dev \
apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo \
apk add cython \
apk add py3-yaml

RUN rm -rf /var/cache/apk/*

0 comments on commit 30d9793

Please sign in to comment.