From 4706e1e6885438948e071d7d9fce5e7014fed97b Mon Sep 17 00:00:00 2001 From: jfouret Date: Wed, 14 Feb 2024 09:31:35 +0100 Subject: [PATCH] first commit --- .github/workflows/docker-publish.yml | 64 ++++++++++++++++++++++++++++ Dockerfile | 17 ++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/docker-publish.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..53f5364 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,64 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + tags: [ '*' ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + IMAGE_NAME: nexomis/pandas + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false + prefix= + suffix= + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: | + org.opencontainers.image.created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} + org.opencontainers.image.revision=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} + org.opencontainers.image.source=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.source'] }} + org.opencontainers.image.url=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.url'] }} + org.opencontainers.image.version=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f606141 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.10-slim-bookworm + +LABEL org.opencontainers.image.title="Python with pandas" +LABEL org.opencontainers.image.authors="Julien FOURET" +LABEL org.opencontainers.image.description="[Pandas](https://pandas.pydata.org/)" +LABEL org.opencontainers.image.vendor="Nexomis" +LABEL org.opencontainers.image.licenses="Apache-2.0 AND BSD-3-Clause" + +ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Paris" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + python3-pandas=1.5.3+dfsg-2 \ + && rm -rf /var/lib/apt/lists/* + +ENTRYPOINT [""] +CMD [""]