From 2b53b768cfff84a333878131f8923a72e6e86a9c Mon Sep 17 00:00:00 2001 From: Anton Griev Date: Fri, 25 Aug 2023 17:16:11 +0200 Subject: [PATCH] fix for https://github.com/latenighttales/alcali/issues/500 --- Dockerfile | 2 +- docker/Dockerfile-master | 24 +++++++++++++++++++----- docker/Dockerfile-minion | 13 +++++++++---- docker/utils/entrypoint-master.sh | 8 +++++++- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 13734eae..372450fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-slim-stretch +FROM python:3.10-bullseye MAINTAINER Matt Melquiond diff --git a/docker/Dockerfile-master b/docker/Dockerfile-master index fda08196..3133fd65 100644 --- a/docker/Dockerfile-master +++ b/docker/Dockerfile-master @@ -1,12 +1,18 @@ -FROM python:3.7-slim-buster +FROM python:3.10-bullseye + +RUN mkdir /etc/apt/keyrings + +RUN curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/debian/11/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/debian/11/amd64/latest bullseye main" | tee /etc/apt/sources.list.d/salt.list # Upgrade System and Install dependencies RUN apt-get update && \ apt-get upgrade -y -o DPkg::Options::=--force-confold && \ apt-get install -y -o DPkg::Options::=--force-confold curl python3-mysqldb netcat # Install Latest Salt from the stable Branch -RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable latest +# RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable latest +RUN apt-get install -y salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api # Set master and id COPY saltconfig/etc/minion /etc/salt/minion @@ -23,11 +29,19 @@ COPY saltconfig/pillar /srv/pillar COPY utils/wait-for . COPY utils/Procfile . COPY utils/entrypoint-master.sh . - -# Sync auth and returners -RUN salt-run saltutil.sync_all +# RUN mkdir /var/cache/salt/master/extmods +# RUN chmod -R a+rwx /var/cache/salt/master/extmods +# RUN chmod -R a+rwx /srv/salt/ +# RUN chmod -R a+rwx /srv/salt/_returners/ +# RUN chmod -R a+rwx /srv/salt/_returners/alcali.py +# # Sync auth and returners +# RUN salt-run saltutil.sync_all # Create salt-api certs RUN salt-call --local tls.create_self_signed_cert cacert_path='/etc/pki' +RUN chmod -R a+rwx /etc/pki/ + +# RUN chmod -R a+rwx /etc/pki/certs +# RUN ls -la /etc/pki/certs ENTRYPOINT ["./entrypoint-master.sh"] diff --git a/docker/Dockerfile-minion b/docker/Dockerfile-minion index ca18662e..efdd5086 100644 --- a/docker/Dockerfile-minion +++ b/docker/Dockerfile-minion @@ -1,13 +1,18 @@ -FROM python:3.7-slim-buster +FROM python:3.10-bullseye + +RUN mkdir /etc/apt/keyrings + +RUN curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/debian/11/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/debian/11/amd64/latest bullseye main" | tee /etc/apt/sources.list.d/salt.list # Upgrade System and Install dependencies RUN apt-get update && \ apt-get upgrade -y -o DPkg::Options::=--force-confold && \ - apt-get install -y -o DPkg::Options::=--force-confold curl netcat + apt-get install -y -o DPkg::Options::=--force-confold curl python3-mysqldb netcat # Install Latest Salt from the stable Branch -RUN curl -L https://bootstrap.saltstack.com | sh -s -- -x python3 stable latest - +# RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable latest +RUN apt-get install -y salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api # Set master COPY saltconfig/etc/minion /etc/salt/minion diff --git a/docker/utils/entrypoint-master.sh b/docker/utils/entrypoint-master.sh index 2c06f173..bb0b4104 100755 --- a/docker/utils/entrypoint-master.sh +++ b/docker/utils/entrypoint-master.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash +mkdir /var/cache/salt/master +chown -R salt:salt /var/cache/salt + +# mkdir /var/cache/salt/master/extmods +# mkdir /var/cache/salt/master/roots +salt-run saltutil.sync_all # Wait for web echo "Waiting for web" ./wait-for -t 60 web:8000 -exec "$@" \ No newline at end of file +exec "$@"