Compare commits

...

2 Commits

Author SHA1 Message Date
Rick Altherr 98d2fc700e Script to build and tag a Docker image 2024-12-11 20:04:06 -08:00
Rick Altherr 04ff977245 Fix barman user's home directory 2024-12-11 20:04:06 -08:00
2 changed files with 9 additions and 2 deletions

View File

@ -13,10 +13,12 @@ RUN curl -o /etc/apt/trusted.gpg.d/apt.postgresql.org.asc --fail https://www.pos
# Create barman user
ENV BARMAN_UID=999
ENV BARMAN_GID=999
ENV BARMAN_DATA_DIR=/var/lib/barman
RUN groupadd --system -g ${BARMAN_GID} barman && \
useradd --system \
-u ${BARMAN_UID} -g ${BARMAN_GID} \
-d ${BARMAN_DATA_DIR} \
--shell /bin/bash \
barman
@ -33,7 +35,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& sed -i 's/\(.*pam_loginuid.so\)/#\1/' /etc/pam.d/cron
ENV BARMAN_CONF_DIR=/etc/barman.d/
ENV BARMAN_DATA_DIR=/var/lib/barman
ENV BARMAN_CRON_SCHEDULE="* * * * *"
VOLUME ${BARMAN_DATA_DIR}
@ -42,4 +43,4 @@ VOLUME ${BARMAN_CONF_DIR}
COPY entrypoint.sh /
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
CMD ["cron", "-L", "3", "-f"]
WORKDIR ${BARMAN_DATA_DIR}
WORKDIR ${BARMAN_DATA_DIR}

6
build_and_tag.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
export COMMIT_DATE=$(date -u -Idate -d @$(git show -s --format=%ct))
export TAG=${COMMIT_DATE}.$(git rev-parse HEAD)
podman image build . -t gitea.treehouse.systems/treehouse/barman:${TAG}
podman tag gitea.treehouse.systems/treehouse/barman:2024-12-09.4a81e73192649d7ad5cdfbdfec94f59e4e145a5b gitea.treehouse.systems/treehouse/barman:latest