Skip to content

Commit

Permalink
adding docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarsoo committed Jan 27, 2025
1 parent f3e5fec commit 97aecc0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gitea
.github
.jenkins
.vscode
build
cmake-build-debug
32 changes: 31 additions & 1 deletion .gitea/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,34 @@ jobs:
- name: Install Deps
run: sudo apt update && sudo apt -y install cmake
- name: Build
run: mkdir build && cd build && ../cbuild
run: mkdir build && cd build && ../cbuild

build-Docker:

runs-on: ubuntu-latest
name: Build Container
needs: [ build ] # for ignoring bad builds
if: gitea.event_name == 'push' && (gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/'))

steps:
- uses: actions/checkout@v4
with:
github-server-url: https://gitea.sheep-ghoul.ts.net

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

- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: gitea.sheep-ghoul.ts.net
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build CLI Container
uses: docker/build-push-action@v6
with:
push: true
tags: gitea.sheep-ghoul.ts.net/sarsoo/knowledgecrawler:latest
file: Dockerfile
context: .
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,30 @@ jobs:
# - name: Install Deps
# run: sudo apt -y install libopencv-dev
- name: Build
run: mkdir build && cd build && ../cbuild
run: mkdir build && cd build && ../cbuild

build-Docker:

runs-on: ubuntu-latest
name: Build Container
needs: [ build ] # for ignoring bad builds
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

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

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build CLI Container
uses: docker/build-push-action@v6
with:
push: true
tags: |
sarsoo/knowledgecrawler:latest
sarsoo/knowledgecrawler:${{ github.ref_name }}
file: Dockerfile
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:latest as build
RUN apk add cmake

WORKDIR /kc
COPY . ./

RUN mkdir build && cd build && ../cbuild

FROM alpine:latest as run
COPY --from=build /kc/build/kc /kc/kc

WORKDIR /kc

ENTRYPOINT ["kc"]

0 comments on commit 97aecc0

Please sign in to comment.