-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build and push docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
#if: startsWith(github.ref, 'refs/tags/') | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
context: . | ||
file: ./docker/Dockerfile.cpu | ||
tags: ${{ steps.meta.outputs.tags }} | ||
build-args: | | ||
"GITHUB_ACTIONS=${GITHUB_ACTIONS}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEVICE=cpu | ||
ARG GITHUB_ACTIONS | ||
|
||
ENV GITHUB_ACTIONS=${GITHUB_ACTIONS} | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# required | ||
RUN apt update \ | ||
&& apt install -y make git pkg-config libssl-dev cmake python3 python3-dev python3-pip binutils-dev libgoogle-glog-dev gcc g++ | ||
|
||
# optional | ||
RUN apt install -y libopencv-dev libomp-dev libtorch3-dev | ||
|
||
RUN pip install setuptools timeout_decorator | ||
|
||
COPY ./ /root/bmf/ | ||
WORKDIR /root/bmf/ | ||
|
||
# ffmpeg installed via apt has no development libraries, so we build it from source | ||
RUN scripts/build_ffmpeg.sh --device=$DEVICE nasm yasm x264 x265 fdk-aac opus \ | ||
&& scripts/build_breakpad.sh \ | ||
&& rm -rf ffmpeg_source | ||
|
||
RUN ./build.sh disable cuda && rm -rf .git && ./build.sh clean | ||
|
||
ENV LD_LIBRARY_PATH=/root/bmf/output/bmf/lib | ||
ENV PATH=${PATH}:/root/bmf/output/bmf/bin | ||
ENV PYTHONPATH=/root/bmf/output |