Skip to content

Commit fc39689

Browse files
committed
test bareos 23 sur alpine
1 parent e11c719 commit fc39689

File tree

7 files changed

+76
-40
lines changed

7 files changed

+76
-40
lines changed

.github/workflows/docker-image.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ jobs:
2525
registry: ${{ env.REGISTRY }}
2626
username: ${{ github.actor }}
2727
password: ${{ secrets.GITHUB_TOKEN }}
28+
# Process for the `storage` subfolder
29+
- name: Extract metadata (tags, labels) for Docker (storage)
30+
id: metaStorage
31+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bareos-storage
34+
tags: |
35+
# set latest tag for default branch
36+
type=raw,value=latest,enable={{is_default_branch}}
37+
- name: Build and push Docker image (storage)
38+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
39+
with:
40+
context: ./storage
41+
push: true
42+
tags: ${{ steps.metaStorage.outputs.tags }}
43+
labels: ${{ steps.metaStorage.outputs.labels }}
44+
platforms: linux/amd64
2845

2946
# Process for the `director` subfolder
3047
- name: Extract metadata (tags, labels) for Docker (director)
@@ -45,4 +62,21 @@ jobs:
4562
labels: ${{ steps.metaDirector.outputs.labels }}
4663
platforms: linux/amd64
4764

65+
# Process for the `webui` subfolder
66+
- name: Extract metadata (tags, labels) for Docker (webui)
67+
id: metaWebui
68+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
69+
with:
70+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bareos-webui
71+
tags: |
72+
# set latest tag for default branch
73+
type=raw,value=latest,enable={{is_default_branch}}
4874
75+
- name: Build and push Docker image (webui)
76+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
77+
with:
78+
context: ./webui
79+
push: true
80+
tags: ${{ steps.metaWebui.outputs.tags }}
81+
labels: ${{ steps.metaWebui.outputs.labels }}
82+
platforms: linux/amd64

director/Dockerfile

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Bareos director Dockerfile
2-
FROM ubuntu:focal
2+
FROM alpine:3.21
33

4-
LABEL maintainer="barcus@tou.nu"
4+
LABEL maintainer="aa@libertech.fr"
55

66
ARG BUILD_DATE
77
ARG NAME
@@ -15,36 +15,13 @@ LABEL org.label-schema.schema-version="1.0" \
1515
org.label-schema.vcs-url="https://github.com/barcus/bareos" \
1616
org.label-schema.version=$VERSION
1717

18-
ENV DEBIAN_FRONTEND noninteractive
19-
ENV BAREOS_KEY http://download.bareos.org/bareos/release/21/xUbuntu_20.04/Release.key
20-
ENV BAREOS_REPO http://download.bareos.org/bareos/release/21/xUbuntu_20.04/
21-
ENV BAREOS_DPKG_CONF bareos-database-common bareos-database-common
22-
23-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
24-
25-
RUN apt-get update -qq \
26-
&& apt-get -qq -y install --no-install-recommends curl tzdata gnupg awscli openssh-client\
27-
&& curl -Ls $BAREOS_KEY -o /tmp/bareos.key \
28-
&& apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \
29-
add /tmp/bareos.key \
30-
&& echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \
31-
&& echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \
32-
| debconf-set-selections \
33-
&& echo "${BAREOS_DPKG_CONF}/install-error select ignore" \
34-
| debconf-set-selections \
35-
&& echo "${BAREOS_DPKG_CONF}/database-type select pgsql" \
36-
| debconf-set-selections \
37-
&& echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \
38-
| debconf-set-selections \
39-
&& echo 'postfix postfix/main_mailer_type select No configuration' \
40-
| debconf-set-selections \
41-
&& apt-get update -qq \
42-
&& apt-get install -qq -y --no-install-recommends \
43-
bareos postgresql-client bareos-tools \
44-
&& apt-get clean \
45-
&& rm -rf /var/lib/apt/lists/*
18+
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
19+
20+
RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar
4621

4722
RUN tar czf /bareos-dir.tgz /etc/bareos
23+
RUN mkdir /run/bareos \
24+
&& chown bareos /run/bareos
4825

4926
COPY webhook-notify /usr/local/bin/webhook-notify
5027
RUN chmod u+x /usr/local/bin/webhook-notify
@@ -55,7 +32,7 @@ RUN chmod u+x /docker-entrypoint.sh
5532
EXPOSE 9101
5633

5734
VOLUME /etc/bareos
35+
VOLUME /var/lib/bareos
5836

5937
ENTRYPOINT ["/docker-entrypoint.sh"]
6038
CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"]
61-

director/webhook-notify

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env sh
21

3-
job_type=$1
2+
b_type=$1
43
job_status=$2
54
job_client=$3
65
job_level=$4

storage/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Dockerfile Bareos storage daemon
2-
FROM arm32v7/alpine:3.17.0
2+
FROM alpine:3.21
33

4-
LABEL maintainer="barcus@tou.nu"
4+
LABEL maintainer="aa@libertech.fr"
55

66
ARG BUILD_DATE
77
ARG NAME
@@ -12,18 +12,16 @@ LABEL org.label-schema.schema-version="1.0" \
1212
org.label-schema.build-date=$BUILD_DATE \
1313
org.label-schema.name=$NAME \
1414
org.label-schema.vcs-ref=$VCS_REF \
15-
org.label-schema.vcs-url="https://github.com/barcus/bareos" \
15+
org.label-schema.vcs-url="https://github.com/Libertech-FR/bareos" \
1616
org.label-schema.version=$VERSION
1717

1818
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
1919

20-
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine/v3.[^/]*\/|https://dl-cdn.alpinelinux.org/alpine/edge/|' /etc/apk/repositories
21-
2220
RUN apk add --no-cache bareos bareos-storage tar
2321

2422
RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d
2523
RUN mkdir /run/bareos \
26-
&& chown bareos /run/bareos
24+
&& chown bareos /run/bareos
2725

2826
COPY docker-entrypoint.sh /docker-entrypoint.sh
2927
RUN chmod u+x /docker-entrypoint.sh
@@ -35,3 +33,4 @@ VOLUME /var/lib/bareos/storage
3533

3634
ENTRYPOINT ["/docker-entrypoint.sh"]
3735
CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"]
36+

storage/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \;
2020

2121
# Run Dockerfile CMD
2222
exec "$@"
23+

webui/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Bareos Web-ui Dockerfile
2-
FROM arm32v7/alpine:3.20
2+
FROM alpine:3.21
33

44
RUN apk add --no-cache bareos-webui-nginx
55

webui/docker-entrypoint.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env ash
2+
3+
if [ ! -f /etc/bareos-webui/bareos-config.control ]
4+
then
5+
tar xfvz /bareos-webui-config.tgz
6+
7+
# Update bareos-webui config
8+
sed -i "s/diraddress = \"localhost\"/diraddress = \"${BAREOS_DIR_HOST}\"/" /etc/bareos-webui/directors.ini
9+
10+
# Control file
11+
touch /etc/bareos-webui/bareos-config.control
12+
fi
13+
14+
if [ ! -f /usr/share/bareos-webui/bareos-config.control ]
15+
then
16+
tar xfvz /bareos-webui-code.tgz
17+
touch /usr/share/bareos-webui/bareos-config.control
18+
fi
19+
20+
# Fix nginx 'client_max_body_size'
21+
sed -i "s#client_max_body_size 1m#client_max_body_size 20m#" /etc/nginx/nginx.conf
22+
23+
# set php-fpm host andd port
24+
sed -i "s/fastcgi_pass 127.0.0.1:9000;/fastcgi_pass ${PHP_FPM_HOST}:${PHP_FPM_PORT};/" /etc/nginx/http.d/bareos-webui.conf
25+
26+
exec "$@"

0 commit comments

Comments
 (0)