Skip to content

Commit

Permalink
Build not only x64
Browse files Browse the repository at this point in the history
refs #27
  • Loading branch information
Al2Klimov committed Jan 4, 2023
1 parent c0d3b57 commit 7e0c228
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
- name: Checkout HEAD
uses: actions/checkout@v1

- name: QEMU
run: sudo apt-get install -y qemu-user-static binfmt-support

- run: docker buildx create --use

- name: Icinga 2
run: git clone https://github.com/Icinga/icinga2.git

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ RUN cd /check_mssql_health ;\
mkdir bin ;\
autoconf ;\
autoreconf ;\
./configure --libexecdir=/usr/lib/nagios/plugins ;\
./configure "--build=$(uname -m)-unknown-linux-gnu" --libexecdir=/usr/lib/nagios/plugins ;\
make ;\
make install "DESTDIR=$(pwd)/bin"

RUN cd /check_nwc_health ;\
mkdir bin ;\
autoreconf ;\
./configure --libexecdir=/usr/lib/nagios/plugins ;\
./configure "--build=$(uname -m)-unknown-linux-gnu" --libexecdir=/usr/lib/nagios/plugins ;\
make ;\
make install "DESTDIR=$(pwd)/bin"

Expand Down
1 change: 1 addition & 0 deletions action.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FROM docker

RUN ["apk", "add", "--no-cache", "bash", "git", "nodejs", "perl"]
COPY --from=clone /actions /actions
COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
ADD . /docker-icinga2

CMD ["/docker-icinga2/action.bash"]
1 change: 1 addition & 0 deletions action.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mkimg () {

env INPUT_FETCH-DEPTH=0 node /actions/checkout/dist/index.js |grep -vFe ::add-matcher::

docker buildx create --use
/docker-icinga2/build.bash .

STATE_isPost=1 node /actions/checkout/dist/index.js
Expand Down
13 changes: 12 additions & 1 deletion build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ EOF
false
fi

if ! docker version; then
echo 'Docker not found' >&2
false
fi

if ! docker buildx version; then
echo '"docker buildx" not found (see https://docs.docker.com/buildx/working-with-buildx/ )' >&2
false
fi

I2SRC="$(realpath "$I2SRC")"
BLDCTX="$(realpath "$(dirname "$0")")"
TMPBLDCTX="$(mktemp -d)"
Expand All @@ -21,5 +31,6 @@ trap "rm -rf $TMPBLDCTX" EXIT
cp -a "${BLDCTX}/." "$TMPBLDCTX"
git clone "file://${I2SRC}/.git" "${TMPBLDCTX}/icinga2-src"

docker build -f "${TMPBLDCTX}/Dockerfile" -t icinga/icinga2 "$TMPBLDCTX"
docker buildx build --platform "$(echo linux/{amd64,arm{/v7,64/v8}} |tr ' ' ,)" -f "${TMPBLDCTX}/Dockerfile" -t icinga/icinga2 "$TMPBLDCTX"

docker run --rm icinga/icinga2 icinga2 daemon -C

0 comments on commit 7e0c228

Please sign in to comment.