Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
agriev committed Aug 25, 2023
1 parent 4a652bc commit 2b53b76
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-slim-stretch
FROM python:3.10-bullseye

MAINTAINER Matt Melquiond

Expand Down
24 changes: 19 additions & 5 deletions docker/Dockerfile-master
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
13 changes: 9 additions & 4 deletions docker/Dockerfile-minion
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 7 additions & 1 deletion docker/utils/entrypoint-master.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
exec "$@"

0 comments on commit 2b53b76

Please sign in to comment.