diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b9ce231 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git/ +.vscode/ +build/ +test/ + +Dockerfile +README.md diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..d803b82 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,42 @@ +name: Create and push Docker build image +on: + push: + branches: [ main ] + tags: [ 'v*.*.*' ] + +jobs: + public_docker_image: + name: Publish Docker image to Github Registry + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/decompals/wibo + + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: mkst + password: ${{ secrets.GHCR_PAT }} + + - name: Build and push to Github registry (latest) + uses: docker/build-push-action@v2 + with: + push: true + tags: ghcr.io/ghcr.io/decompals/wibo:latest + if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} + + - name: Build and push to Github registry (versioned) + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + if: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..23c3617 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:22.04 as build + +RUN apt-get update && apt-get install -y --no-install-recommends g++ g++-multilib make + +COPY . /WiBo + +RUN make -C /WiBo + + +FROM ubuntu:22.04 + +RUN dpkg --add-architecture i386 \ + && apt-get update \ + && apt-get install -y --no-install-recommends libstdc++6:i386 + +COPY --from=build /WiBo/wibo /usr/local/sbin/wibo + +CMD /usr/local/sbin/wibo