Skip to content

Commit

Permalink
[Elao - App - Docker] Debian 12
Browse files Browse the repository at this point in the history
  • Loading branch information
nervo committed Apr 12, 2024
1 parent 7c9e9c6 commit 8b55d01
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 28 deletions.
2 changes: 1 addition & 1 deletion elao.app.docker/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project:

system:
# @option {"label": "System version"}
# @schema {"enum": [11, 10]}
# @schema {"enum": [12, 11, 10]}
version: ~
# @schema {"type": "string", "pattern": "^[a-zA-Z]+/[a-zA-Z]+$"}
timezone: Etc/UTC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ collections:
- community.mongodb
- community.mysql
- gluster.gluster
- manala.roles
# !!! Not Ready !!!
#- manala.roles
- name: https://github.com/manala/ansible-roles.git
type: git
version: apt/deb822
8 changes: 6 additions & 2 deletions elao.app.docker/.manala/ansible/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@
manala_apt_components:
- main

manala_apt_sources_list_template: apt/sources.list.j2
manala_apt_sources_list: false

manala_apt_repositories_exclusive: true
manala_apt_repositories: "{{ system_apt_repositories }}"
manala_apt_repositories:
- default
- updates
- security
- "{{ system_apt_repositories }}"

manala_apt_preferences_exclusive: true
manala_apt_preferences:
Expand Down
3 changes: 0 additions & 3 deletions elao.app.docker/.manala/ansible/templates/apt/sources.list.j2

This file was deleted.

37 changes: 19 additions & 18 deletions elao.app.docker/.manala/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ RUN \
/var/cache/apt/archives/libssl1.1.deb ; \
fi \
{{- end }}
# Apt keyrings (debian < bookworm)
&& install --verbose --mode 0755 --directory /etc/apt/keyrings \
# User
&& addgroup --gid ${MANALA_GROUP_ID} app \
&& adduser --home /home/app --shell /bin/bash --uid ${MANALA_USER_ID} --gecos app --ingroup app --disabled-password app \
&& echo "app ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/app \
# Clean
&& rm -rf /var/lib/apt/lists/*
&& echo "app ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/app

{{ if .goss.version -}}
# Goss
Expand Down Expand Up @@ -92,6 +88,7 @@ RUN \
mv /usr/bin/ischroot /usr/bin/ischroot_ \
&& ln -s /bin/true /usr/bin/ischroot \
&& apt-get --quiet update \
&& apt-get --quiet --yes --purge --autoremove upgrade \
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
sysvinit-core \
&& mv /usr/bin/ischroot_ /usr/bin/ischroot \
Expand Down Expand Up @@ -134,9 +131,7 @@ RUN \
Package: systemd-sysv\n\
Pin: release *\n\
Pin-Priority: -1\n\
" > /etc/apt/preferences \
# Clean
&& rm -rf /var/lib/apt/lists/*
" > /etc/apt/preferences

STOPSIGNAL SIGINT

Expand All @@ -150,10 +145,9 @@ FROM system AS init-openrc
RUN \
rm -f /etc/init.d/hwclock.sh \
&& apt-get --quiet update \
&& apt-get --quiet --yes --purge --autoremove upgrade \
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
openrc \
# Clean
&& rm -rf /var/lib/apt/lists/*
openrc

STOPSIGNAL SIGINT

Expand All @@ -166,6 +160,7 @@ FROM system AS init-systemd

RUN \
apt-get --quiet update \
&& apt-get --quiet --yes --purge --autoremove upgrade \
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
systemd dbus \
&& systemctl set-default multi-user.target \
Expand All @@ -180,9 +175,7 @@ RUN \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev* \
/lib/systemd/system/systemd-update-utmp* \
# Clean
&& rm -rf /var/lib/apt/lists/*
/lib/systemd/system/systemd-update-utmp*

VOLUME /sys/fs/cgroup

Expand Down Expand Up @@ -216,19 +209,29 @@ COPY --from=python:3.9.2-slim-buster /usr/local/lib/python3.9/ /usr/local/lib/py
{{- end }}
RUN \
apt-get --quiet update \
&& apt-get --quiet --yes --purge --autoremove upgrade \
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
# As managed node
python3 \
python3-apt \
# !!! Not Ready !!! (Only useful to temporary get ansible manala.roles collection as a git repo)
git \
{{- if eq (.version|int) 10 }}
&& ldconfig \
&& python3.9 -m pip --no-cache-dir --disable-pip-version-check install \
ansible==${ANSIBLE_VERSION} \
{{- else }}
{{- else if eq (.version|int) 11 }}
# As controller node
python3-pip \
&& pip3 --no-cache-dir --disable-pip-version-check install \
ansible==${ANSIBLE_VERSION} \
{{- else }}
# As controller node
pipx \
&& PIPX_HOME="/usr/local/pipx" PIPX_BIN_DIR="/usr/local/bin" \
pipx install ansible==${ANSIBLE_VERSION} \
--include-deps --pip-args="--no-cache-dir" --verbose \
&& rm -rf ~/.cache/pip /usr/local/pipx/.cache /usr/local/pipx/logs \
{{- end }}
&& install --verbose --mode 0755 --directory /etc/ansible \
&& printf "\
Expand All @@ -243,9 +246,7 @@ check_mode_markers = True\n\
pipelining = True\n\
[privilege_escalation]\n\
become_flags = -E\n\
" > /etc/ansible/ansible.cfg \
# Clean
&& rm -rf /var/lib/apt/lists/*
" > /etc/ansible/ansible.cfg

COPY Makefile ./.manala/
COPY ansible/ ./.manala/ansible/
Expand Down
2 changes: 1 addition & 1 deletion elao.app.docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ project:
##########

system:
version: 11
version: 12
#timezone: Etc/UTC # Optional
#locales: # Optional
# default: C.UTF-8
Expand Down
2 changes: 1 addition & 1 deletion elao.app.docker/test/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project:
ports_prefix: 123

system:
version: 11
version: 12
timezone: Europe/Paris
locales:
default: C.UTF-8
Expand Down
2 changes: 1 addition & 1 deletion elao.app.docker/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include .manala/Makefile

_HADOLINT_VERSION = 2.12.0
_HADOLINT_IGNORE = DL3008,SC1091,DL3006,DL3045
_HADOLINT_IGNORE = DL3008,SC1091,DL3006,DL3045,DL3009

.manala:
$(error Please, run "manala up" before)
Expand Down
4 changes: 4 additions & 0 deletions elao.app.docker/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ command:
locale --all-locales:
exit-status: 0
stdout:
{{- if le (.Vars.system.version|int) 11 }}
- {{ .Vars.system.locales.default }}
{{- else }}
- {{ .Vars.system.locales.default | replace "UTF-8" "utf8" }}
{{- end }}
{{- range $code := .Vars.system.locales.codes }}
- {{ $code | replace "UTF-8" "utf8" }}
{{- end }}
Expand Down

0 comments on commit 8b55d01

Please sign in to comment.