Skip to content

Commit

Permalink
GH-705: Docker underthesea
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Aug 19, 2023
1 parent 419346e commit c6b9ffd
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

jobs:
docker:
if: contains(github.event.head_commit.message, 'Build docker')
if: contains(github.event.head_commit.message, 'Docker build image')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/docker-underthesea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
branches:
- 'core'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/underthesea
VERSION: 0.1.0

jobs:
docker:
if: contains(github.event.head_commit.message, 'Docker underthesea')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.version=${{ env.VERSION }}
tags: |
type=raw,value=${{ env.VERSION }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./extensions/docker/underthesea-image/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions extensions/docker/underthesea-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM alpine:3.16
# Install required packages
RUN apk add --no-cache \
python3 \
py3-pip \
curl \
build-base \
pkgconfig \
openssl-dev \
libressl-dev \
bash \
rust \
cargo \
py3-scikit-learn && \
pip3 install maturin patchelf
# Install underthesea_core
RUN curl -O https://files.pythonhosted.org/packages/b3/7f/8d136185263619e25473af7584bb224918a3546975afeb375b87b3bcae20/underthesea_core-1.0.4.tar.gz && \
tar -xvf underthesea_core-1.0.4.tar.gz && \
rm underthesea_core-1.0.4.tar.gz && \
cd underthesea_core-1.0.4 && \
maturin build && \
pip3 install target/wheels/*.whl
# Install underthesea_core
RUN pip install underthesea
5 changes: 5 additions & 0 deletions extensions/docker/underthesea-image/HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# HISTORY

## 0.1.0 (2023-08-19)

* Create docker image for underthesea in alpine linux
3 changes: 3 additions & 0 deletions extensions/docker/underthesea-image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Underthsea Image

**Note**: Push commit to branch `core` with messages 'Docker underthesea' will trigger `docker-underthesea` actions.
1 change: 1 addition & 0 deletions extensions/docker/underthesea-image/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit c6b9ffd

Please sign in to comment.