diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..36b05a78ac --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +name: publish-docker +on: + workflow_dispatch: + inputs: + tag: + description: 'The git tag to build' + type: string + required: true + default: "v3.4.4" +jobs: + publish: + name: 'Publish OIBus to ghcr.io' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.tag }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:build/docker" + platforms: linux/amd64,linux/arm64 + push: true + build-args: | + VERSION=${{ github.event.inputs.tag }} + tags: | + ghcr.io/optimistiksas/oibus:latest + ghcr.io/optimistiksas/oibus:${{ github.event.inputs.tag }} + diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index 5890d1767c..454d835109 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -1,7 +1,12 @@ FROM ubuntu -ARG arch="x64" -ARG version="v3.3.2" +ARG TARGETARCH +# TARGETARCH is either amd64 or arm64 +# amd64 is mapped to x64 +ARG ARCH=${TARGETARCH/amd64/x64} +ARG VERSION="v3.3.2" + +RUN echo "${ARCH}-${VERSION}" # Install git RUN apt update -y && apt install -y curl unzip @@ -9,14 +14,13 @@ RUN apt update -y && apt install -y curl unzip # Create app directory WORKDIR /app -RUN curl -LO https://github.com/OptimistikSAS/OIBus/releases/download/${version}/oibus-linux_${arch}-${version}.zip -RUN unzip -a oibus-linux_${arch}-${version}.zip -d OIBus/ +RUN curl -LO https://github.com/OptimistikSAS/OIBus/releases/download/${VERSION}/oibus-linux_${ARCH}-${VERSION}.zip +RUN unzip -a oibus-linux_${ARCH}-${VERSION}.zip -d OIBus/ WORKDIR /app/OIBus -COPY ./oibus-init.sh . RUN mkdir OIBusData # Expose port 2223 for OIBus EXPOSE 2223 # Start OIBus -CMD ["./oibus-launcher", "--config", "./OIBusData"] \ No newline at end of file +CMD ["./oibus-launcher", "--config", "./OIBusData", "--ignoreIpFilters", "true", "--ignoreRemoteUpdate", "true"] \ No newline at end of file diff --git a/build/docker/oibus-init.sh b/build/docker/oibus-init.sh deleted file mode 100755 index dc03b2a996..0000000000 --- a/build/docker/oibus-init.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -curl --location --request POST 'http://localhost:2223/api/ip-filters' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "address": "*", - "description": "All" -}' \ --u "admin:pass"