Skip to content

Commit

Permalink
Merge pull request #85 from r-lib/feature/docker-image
Browse files Browse the repository at this point in the history
Docker image with nanoparquet
  • Loading branch information
gaborcsardi authored Sep 9, 2024
2 parents f9043e8 + 13e2752 commit 0c0c8c7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: docker-container.yaml

on:
workflow_dispatch:
schedule:
- cron: '55 22 6 * 6'
release:
types: [published]

jobs:
build:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
file: tools/docker/Dockerfile
tags: ${{ env.GITHUB_REF_TYPE == "tag" && env.GITHUB_REF_NAME || 'devel' }}
12 changes: 12 additions & 0 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ghcr.io/r-hub/r-minimal/r-minimal:release AS build

COPY . /root/nanoparquet

RUN installr -d local::/root/nanoparquet

FROM ghcr.io/r-hub/r-minimal/r-minimal:release AS final

COPY --from=build /usr/local/lib/R/library/nanoparquet /usr/local/lib/R/library/nanoparquet

RUN R -q -e 'library(nanoparquet); write_parquet(mtcars, "/tmp/mtcars.parquet"); read_parquet("/tmp/mtcars.parquet")' && \
rm -rf /tmp/Rtmp*

0 comments on commit 0c0c8c7

Please sign in to comment.