Unverified Commit f123913f authored by Fedor Batonogov's avatar Fedor Batonogov Committed by GitHub
Browse files

Added slim version for linux container (#57)

parent 703c14ad
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+94 −0
Original line number Diff line number Diff line
# Git
.git
.gitignore
.gitattributes

# CI
.codeclimate.yml
.travis.yml
.taskcluster.yml

# Docker
docker-compose.yml
Dockerfile*
.docker
.dockerignore

# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Virtual environment
.env
.venv/
venv/

# PyCharm
.idea

# Python mode for VIM
.ropeproject
**/.ropeproject

# Vim swap files
**/*.swp

# VS Code
.vscode/

# Other
README.md
.pre-commit-config.yaml
test
.github
+16 −12
Original line number Diff line number Diff line
@@ -4,9 +4,6 @@ on:
  push:
    tags: [ 'v*.*.*' ]

env:
  DOCKERFILE: Dockerfile-py3-linux

jobs:
  build_and_push_to_registry:
    name: Push Docker image to Docker Hub
@@ -27,11 +24,17 @@ jobs:
        with:
          images: ${{ secrets.DOCKERHUB_USERNAME }}/pyinstaller-linux

      - name: Extract metadata (tags, labels) for Docker
        id: meta-slim
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ secrets.DOCKERHUB_USERNAME }}/pyinstaller-linux-slim

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2

      - name: Build and push Docker image (branch)
        if: github.ref != 'refs/heads/main'
      - name: Build and push Docker image
        if: ${{ startsWith(github.ref, 'refs/tags/*') }}
        uses: docker/build-push-action@v3
        with:
          context: .
@@ -43,13 +46,14 @@ jobs:
            linux/arm64/v8
            linux/ppc64le
            linux/s390x
          file: ${{ env.DOCKERFILE }}
          file: Dockerfile-py3-linux
          push: true
          tags: |
            ${{ steps.meta.outputs.tags }}
            ${{ github.ref_name }}
            ${{ secrets.DOCKERHUB_USERNAME }}/pyinstaller-linux:latest
          labels: ${{ steps.meta.outputs.labels }}

      - name: Build and push Docker image (release)
      - name: Build and push Docker image slim
        if: ${{ startsWith(github.ref, 'refs/tags/*') }}
        uses: docker/build-push-action@v3
        with:
@@ -62,9 +66,9 @@ jobs:
            linux/arm64/v8
            linux/ppc64le
            linux/s390x
          file: ${{ env.DOCKERFILE }}
          file: Dockerfile-py3-linux-slim
          push: true
          tags: |
            ${{ github.ref_name }}"
            ${{ secrets.DOCKERHUB_USERNAME }}/pyinstaller-linux:latest
          labels: ${{ steps.meta.outputs.labels }}
            ${{ github.ref_name }}
            ${{ secrets.DOCKERHUB_USERNAME }}/pyinstaller-linux-slim:latest
          labels: ${{ steps.meta-slim.outputs.labels }}
+9 −0
Original line number Diff line number Diff line
@@ -27,6 +27,15 @@ jobs:
            echo "Building image to test"
            ./build-and-test.sh Dockerfile-py3-linux

  linux-slim:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3
      - name: Run Tests
        run: |
            echo "Building image to test"
            ./build-and-test.sh Dockerfile-py3-linux-slim
  osx:
    runs-on: ubuntu-latest
    steps:
+3 −1
Original line number Diff line number Diff line
@@ -10,7 +10,9 @@ ENV PYPI_INDEX_URL=https://pypi.python.org/simple

COPY entrypoint-linux.sh /entrypoint.sh

RUN pip3 install pyinstaller==$PYINSTALLER_VERSION \
RUN pip3 install \
        pyinstaller==$PYINSTALLER_VERSION \
    && pip3 cache purge \
    && chmod +x /entrypoint.sh

VOLUME /src/
+25 −0
Original line number Diff line number Diff line
FROM python:3.12.2-slim
SHELL ["/bin/bash", "-i", "-c"]

LABEL maintainer="f.batonogov@yandex.ru"

ARG PYINSTALLER_VERSION=6.3.0

ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple

COPY entrypoint-linux.sh /entrypoint.sh

RUN apt update \
    && apt install -y \
        binutils \
    && rm -rf /var/lib/apt/lists/* \
    && pip3 install \
        pyinstaller==$PYINSTALLER_VERSION \
    && pip3 cache purge \
    && chmod +x /entrypoint.sh

VOLUME /src/
WORKDIR /src/

ENTRYPOINT ["/entrypoint.sh"]
Loading