Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: create multi platform docker images #3616

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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 }}

16 changes: 10 additions & 6 deletions build/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
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

# 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"]
CMD ["./oibus-launcher", "--config", "./OIBusData", "--ignoreIpFilters", "true", "--ignoreRemoteUpdate", "true"]
9 changes: 0 additions & 9 deletions build/docker/oibus-init.sh

This file was deleted.