Skip to content

Commit 4b38fb5

Browse files
committed
Merge branch 'master' into latest
2 parents 8c126b2 + 257b65a commit 4b38fb5

13 files changed

Lines changed: 335 additions & 349 deletions

.github/workflows/latest.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
# set docker tag for all steps
1212
env:
1313
DOCKERTAG: latest
14+
DOCKER_BUILD_SUMMARY: 0
15+
DOCKER_BUILD_RECORD_UPLOAD: 0
1416

1517
jobs:
1618
docker_build:
@@ -31,27 +33,32 @@ jobs:
3133
platform: arm64
3234
steps:
3335
- name: Check out the repo
34-
uses: actions/checkout@v4
36+
uses: actions/checkout@v6
3537

3638
- name: Log in to Docker Hub
37-
uses: docker/login-action@v3
39+
uses: docker/login-action@v4
3840
with:
3941
username: ${{ secrets.DOCKER_USERNAME }}
4042
password: ${{ secrets.DOCKER_PASSWORD }}
4143

4244
- name: Log in to GitHub Docker Registry
43-
uses: docker/login-action@v3
45+
uses: docker/login-action@v4
4446
with:
4547
registry: ghcr.io
4648
username: ${{ secrets.REGISTRY_USER }}
4749
password: ${{ secrets.PTA }}
4850

4951
- name: Build and Push
50-
uses: docker/build-push-action@v6
52+
uses: docker/build-push-action@v7
5153
with:
5254
push: true
5355
file: Dockerfile.omd-labs-${{ matrix.os }}
54-
build-args: OMD_VERSION=${{ github.ref }}
56+
sbom: false
57+
provenance: false
58+
build-args: |
59+
OMD_VERSION=${{ github.ref }}
60+
INSTALL_COMMON_RETRIES=3
61+
BUILDKIT_MULTI_PLATFORM=0
5562
tags: |
5663
consol/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
5764
ghcr.io/consol/omd-labs-docker/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
@@ -70,16 +77,16 @@ jobs:
7077
- rocky
7178
- debian
7279
steps:
73-
- uses: actions/checkout@v4
80+
- uses: actions/checkout@v6
7481

7582
- name: Log in to Docker Hub
76-
uses: docker/login-action@v3
83+
uses: docker/login-action@v4
7784
with:
7885
username: ${{ secrets.DOCKER_USERNAME }}
7986
password: ${{ secrets.DOCKER_PASSWORD }}
8087

8188
- name: Log in to GitHub Docker Registry
82-
uses: docker/login-action@v3
89+
uses: docker/login-action@v4
8390
with:
8491
registry: ghcr.io
8592
username: ${{ secrets.REGISTRY_USER }}

.github/workflows/nightly.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ on:
77
tags-ignore:
88
- '*'
99
workflow_dispatch:
10+
inputs:
11+
debug_enabled:
12+
type: boolean
13+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
14+
required: false
15+
default: false
1016

1117
# set docker tag for all steps
1218
env:
1319
DOCKERTAG: nightly
20+
DOCKER_BUILD_SUMMARY: 0
21+
DOCKER_BUILD_RECORD_UPLOAD: 0
1422

1523
jobs:
1624
docker_build:
@@ -31,27 +39,32 @@ jobs:
3139
platform: arm64
3240
steps:
3341
- name: Check out the repo
34-
uses: actions/checkout@v4
42+
uses: actions/checkout@v6
3543

3644
- name: Log in to Docker Hub
37-
uses: docker/login-action@v3
45+
uses: docker/login-action@v4
3846
with:
3947
username: ${{ secrets.DOCKER_USERNAME }}
4048
password: ${{ secrets.DOCKER_PASSWORD }}
4149

4250
- name: Log in to GitHub Docker Registry
43-
uses: docker/login-action@v3
51+
uses: docker/login-action@v4
4452
with:
4553
registry: ghcr.io
4654
username: ${{ secrets.REGISTRY_USER }}
4755
password: ${{ secrets.PTA }}
4856

4957
- name: Build and Push
50-
uses: docker/build-push-action@v6
58+
uses: docker/build-push-action@v7
5159
with:
5260
push: true
5361
file: Dockerfile.omd-labs-${{ matrix.os }}
54-
build-args: OMD_VERSION=${{ github.ref }}
62+
sbom: false
63+
provenance: false
64+
build-args: |
65+
OMD_VERSION=${{ github.ref }}
66+
INSTALL_COMMON_RETRIES=3
67+
BUILDKIT_MULTI_PLATFORM=0
5568
tags: |
5669
consol/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
5770
ghcr.io/consol/omd-labs-docker/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
@@ -70,21 +83,25 @@ jobs:
7083
- rocky
7184
- debian
7285
steps:
73-
- uses: actions/checkout@v4
86+
- uses: actions/checkout@v6
7487

7588
- name: Log in to Docker Hub
76-
uses: docker/login-action@v3
89+
uses: docker/login-action@v4
7790
with:
7891
username: ${{ secrets.DOCKER_USERNAME }}
7992
password: ${{ secrets.DOCKER_PASSWORD }}
8093

8194
- name: Log in to GitHub Docker Registry
82-
uses: docker/login-action@v3
95+
uses: docker/login-action@v4
8396
with:
8497
registry: ghcr.io
8598
username: ${{ secrets.REGISTRY_USER }}
8699
password: ${{ secrets.PTA }}
87100

101+
- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate
102+
uses: mxschmitt/action-tmate@v3
103+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
104+
88105
- name: push manifest to dockerhub
89106
run: |
90107
docker manifest create consol/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }} \

.github/workflows/releases.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
# set docker tag for all steps
1212
env:
1313
DOCKERTAG: ${{ github.head_ref || github.ref_name }}
14+
DOCKER_BUILD_SUMMARY: 0
15+
DOCKER_BUILD_RECORD_UPLOAD: 0
1416

1517
jobs:
1618
docker_build:
@@ -31,27 +33,32 @@ jobs:
3133
platform: arm64
3234
steps:
3335
- name: Check out the repo
34-
uses: actions/checkout@v4
36+
uses: actions/checkout@v6
3537

3638
- name: Log in to Docker Hub
37-
uses: docker/login-action@v3
39+
uses: docker/login-action@v4
3840
with:
3941
username: ${{ secrets.DOCKER_USERNAME }}
4042
password: ${{ secrets.DOCKER_PASSWORD }}
4143

4244
- name: Log in to GitHub Docker Registry
43-
uses: docker/login-action@v3
45+
uses: docker/login-action@v4
4446
with:
4547
registry: ghcr.io
4648
username: ${{ secrets.REGISTRY_USER }}
4749
password: ${{ secrets.PTA }}
4850

4951
- name: Build and Push
50-
uses: docker/build-push-action@v6
52+
uses: docker/build-push-action@v7
5153
with:
5254
push: true
5355
file: Dockerfile.omd-labs-${{ matrix.os }}
54-
build-args: OMD_VERSION=${{ github.ref }}
56+
sbom: false
57+
provenance: false
58+
build-args: |
59+
OMD_VERSION=${{ github.ref }}
60+
INSTALL_COMMON_RETRIES=3
61+
BUILDKIT_MULTI_PLATFORM=0
5562
tags: |
5663
consol/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
5764
ghcr.io/consol/omd-labs-docker/omd-labs-${{ matrix.os }}:${{ env.DOCKERTAG }}-${{ matrix.target.platform }}
@@ -70,16 +77,16 @@ jobs:
7077
- rocky
7178
- debian
7279
steps:
73-
- uses: actions/checkout@v4
80+
- uses: actions/checkout@v6
7481

7582
- name: Log in to Docker Hub
76-
uses: docker/login-action@v3
83+
uses: docker/login-action@v4
7784
with:
7885
username: ${{ secrets.DOCKER_USERNAME }}
7986
password: ${{ secrets.DOCKER_PASSWORD }}
8087

8188
- name: Log in to GitHub Docker Registry
82-
uses: docker/login-action@v3
89+
uses: docker/login-action@v4
8390
with:
8491
registry: ghcr.io
8592
username: ${{ secrets.REGISTRY_USER }}

Dockerfile.omd-labs-debian

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM debian:12
1+
FROM debian:13
22
LABEL org.opencontainers.image.authors="sven.nierlein@consol.de"
33
LABEL org.opencontainers.image.source="https://github.com/ConSol-Monitoring/omd-labs-docker"
44
EXPOSE 80 443 22 4730 5666
55

6-
ENV REFRESHED=20250123
6+
ENV REFRESHED=20250918
77

88
#### user environment ######################################
99
ENV HOME=/root
@@ -13,9 +13,10 @@ RUN chmod +x $HOME/start.sh
1313

1414
### OMD installation ######################################
1515
ARG OMD_VERSION
16+
ARG INSTALL_COMMON_RETRIES=1
1617
ADD ./scripts/install_*.sh $HOME/
1718
RUN chmod +x $HOME/install_*.sh
18-
RUN $HOME/install_common.sh debian
19+
RUN $HOME/install_retry.sh -r $INSTALL_COMMON_RETRIES -d 30 -- $HOME/install_common.sh debian
1920
RUN $HOME/install_omd.sh debian $OMD_VERSION
2021

2122
#### ansible ################################################
@@ -40,12 +41,13 @@ ENV SITENAME=$SITENAME
4041
RUN echo "export SITENAME=$SITENAME" > .sitename.env
4142
RUN sed -i 's|echo "on"$|echo "off"|' /opt/omd/versions/default/lib/omd/hooks/TMPFS
4243
RUN echo "create OMD site: $SITENAME" && omd create -u 1000 -g 1000 $SITENAME
44+
RUN install -m 0700 -o $SITENAME -g $SITENAME -d /omd/sites/$SITENAME/.ansible /omd/sites/$SITENAME/.ansible/tmp
4345

4446
# -- ONBUILD
4547
# when used as a base image, this instructions trigger the creation of another site if NEW_SITENAME is not `demo`
4648
ONBUILD ARG NEW_SITENAME=demo
4749
ONBUILD ENV NEW_SITENAME=$NEW_SITENAME
48-
ONBUILD RUN [ "$NEW_SITENAME" != "demo" ] && echo "export SITENAME=$NEW_SITENAME" > .sitename.env && echo "CREATE new site:$NEW_SITENAME" && omd -f rm $SITENAME && omd create -u 1001 -g 1001 $NEW_SITENAME || true
50+
ONBUILD RUN [ "$NEW_SITENAME" != "demo" ] && echo "export SITENAME=$NEW_SITENAME" > .sitename.env && echo "CREATE new site:$NEW_SITENAME" && omd -f rm $SITENAME && omd create -u 1001 -g 1001 $NEW_SITENAME && install -m 0700 -o $NEW_SITENAME -g $NEW_SITENAME -d /omd/sites/$NEW_SITENAME/.ansible /omd/sites/$NEW_SITENAME/.ansible/tmp || true
4951

5052
ENV APACHE_CMD="exec /usr/sbin/apache2ctl -D FOREGROUND"
5153
CMD ["/root/start.sh"]

Dockerfile.omd-labs-rocky

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ LABEL org.opencontainers.image.authors="sven.nierlein@consol.de"
33
LABEL org.opencontainers.image.source="https://github.com/ConSol-Monitoring/omd-labs-docker"
44
EXPOSE 80 443 22 4730 5666
55

6-
ENV REFRESHED=20250123
6+
ENV REFRESHED=20250918
77

88
#### user environment ######################################
99
ENV HOME=/root
@@ -13,9 +13,10 @@ RUN chmod +x $HOME/start.sh
1313

1414
### OMD installation ######################################
1515
ARG OMD_VERSION
16+
ARG INSTALL_COMMON_RETRIES=1
1617
ADD ./scripts/install_*.sh $HOME/
1718
RUN chmod +x $HOME/install_*.sh
18-
RUN $HOME/install_common.sh rocky
19+
RUN $HOME/install_retry.sh -r $INSTALL_COMMON_RETRIES -d 30 -- $HOME/install_common.sh rocky
1920
RUN $HOME/install_omd.sh rocky $OMD_VERSION
2021

2122
#### ansible ################################################
@@ -40,12 +41,13 @@ ENV SITENAME=$SITENAME
4041
RUN echo "export SITENAME=$SITENAME" > .sitename.env
4142
RUN sed -i 's|echo "on"$|echo "off"|' /opt/omd/versions/default/lib/omd/hooks/TMPFS
4243
RUN echo "create OMD site: $SITENAME" && omd create -u 1000 -g 1000 $SITENAME
44+
RUN install -m 0700 -o $SITENAME -g $SITENAME -d /omd/sites/$SITENAME/.ansible /omd/sites/$SITENAME/.ansible/tmp
4345

4446
# -- ONBUILD
4547
# when used as a base image, this instructions trigger the creation of another site if NEW_SITENAME is not `demo`
4648
ONBUILD ARG NEW_SITENAME=demo
4749
ONBUILD ENV NEW_SITENAME=$NEW_SITENAME
48-
ONBUILD RUN [ "$NEW_SITENAME" != "demo" ] && echo "export SITENAME=$NEW_SITENAME" > .sitename.env && echo "CREATE new site:$NEW_SITENAME" && omd -f rm $SITENAME && omd create -u 1001 -g 1001 $NEW_SITENAME || true
50+
ONBUILD RUN [ "$NEW_SITENAME" != "demo" ] && echo "export SITENAME=$NEW_SITENAME" > .sitename.env && echo "CREATE new site:$NEW_SITENAME" && omd -f rm $SITENAME && omd create -u 1001 -g 1001 $NEW_SITENAME && install -m 0700 -o $NEW_SITENAME -g $NEW_SITENAME -d /omd/sites/$NEW_SITENAME/.ansible /omd/sites/$NEW_SITENAME/.ansible/tmp || true
4951

5052
ENV APACHE_CMD="exec /usr/sbin/httpd -D FOREGROUND"
5153
CMD ["/root/start.sh"]

Makefile.common

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This file is used to manage local images
2+
# depending of the current dir and branch.
3+
# Branch 'master' leads to no tag (=latest),
4+
# others to "local/[dirname]:[branchname]
5+
6+
ifeq ($(strip $(DISTRO)),)
7+
$(error DISTRO must not be empty, use Makefile.omd-labs-* instead)
8+
endif
9+
10+
LOCAL_HTTPS_PORT ?= 8443
11+
12+
# local builds will be named like this
13+
REPO = local/omd-labs-$(DISTRO)
14+
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
15+
# BRANCH=TAG, but "master"="nightly"
16+
TAG = $(shell git rev-parse --abbrev-ref HEAD | sed 's/master/nightly/')
17+
# the final image name
18+
IMAGE=$(REPO):$(TAG)
19+
20+
# will create another OMD site SITENAME, if set
21+
ifdef SITENAME
22+
BUILDARGS = --build-arg SITENAME=$(SITENAME)
23+
else
24+
SITENAME=demo
25+
endif
26+
27+
export DOCKER_REPO=index.docker.io/consol/omd-labs-$(DISTRO)
28+
export IMAGE_NAME=$(IMAGE)
29+
export SOURCE_BRANCH=$(BRANCH)
30+
31+
.PHONY: build bash start echo
32+
33+
build:
34+
# the hook is also executed on Docker Hub
35+
./hooks/build $(BUILDARGS)
36+
@echo "Successfully built" $(IMAGE)
37+
38+
start:
39+
docker run -p $(LOCAL_HTTPS_PORT):443 -d $(IMAGE)
40+
41+
startvol:
42+
mkdir -p site
43+
docker run -d -p $(LOCAL_HTTPS_PORT):443 \
44+
-v $(shell pwd)/site:/omd/sites/$(SITENAME) \
45+
$(IMAGE)
46+
47+
echo:
48+
@echo $(IMAGE)
49+
50+
bash:
51+
docker run --rm -p $(LOCAL_HTTPS_PORT):443 -it $(IMAGE) /bin/bash
52+
53+
bashvol:
54+
docker run --rm -p $(LOCAL_HTTPS_PORT):443 -it \
55+
-v $(shell pwd)/site:/omd/sites/$(SITENAME) \
56+
$(IMAGE) /bin/bash

0 commit comments

Comments
 (0)