Merge pull request #18 from cdalvaro/upgrade/v3000

Upgrade to v3000 Neon
This commit is contained in:
Carlos D. Álvaro
2020-02-11 19:47:42 +01:00
committed by GitHub
6 changed files with 33 additions and 28 deletions

View File

@@ -1,7 +1,13 @@
# Changelog
This file only reflects the changes that are made in this image.
Please refer to the SaltStack [Release Notes](https://docs.saltstack.com/en/latest/topics/releases/2019.2.3.html) for the list of changes in SaltStack.
Please refer to the SaltStack [Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3000.html) for the list of changes in SaltStack.
**3000**
- Upgrade SaltStack Master to `3000` *Neon*
- Change Docker base image to `ubuntu:bionic-20200112`
- Upgrade pygit2 to version `1.0.3`
**2019.2.3**

View File

@@ -1,14 +1,14 @@
FROM ubuntu:bionic-20191202
FROM ubuntu:bionic-20200112
ARG BUILD_DATE
ARG VCS_REF
# https://github.com/saltstack/salt/releases
ENV SALT_VERSION="2019.2.3" \
ENV SALT_VERSION="3000" \
PYTHON_VERSION="3.6" \
LIBSSH2_VERSION="1.9.0" \
LIBGIT2_VERSION="0.28.4" \
PYGIT2_VERSION="1.0.2" \
PYGIT2_VERSION="1.0.3" \
M2CRYPTO_VERSION="0.35.2"
ENV SALT_DOCKER_DIR="/etc/docker-salt" \

View File

@@ -1,4 +1,4 @@
# SaltStack Master v2019.2.3
# SaltStack Master v3000
Dockerfile to build a [SaltStack](https://www.saltstack.com) Master image for the Docker opensource container platform.
@@ -30,7 +30,7 @@ For other methods to install SaltStack please refer to the [Official SaltStack I
Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/cdalvaro/saltstack-master/) and is the recommended method of installation.
```sh
docker pull cdalvaro/saltstack-master:2019.2.3
docker pull cdalvaro/saltstack-master:3000
```
You can also pull the latest tag which is built from the repository HEAD
@@ -67,7 +67,7 @@ docker run --name salt_master --detach \
--env 'SALT_LOG_LEVEL=info' \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
## Configuration
@@ -91,7 +91,7 @@ docker run --name salt_master -d \
--env 'SALT_LOG_LEVEL=info' \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
### Master Signed Keys
@@ -105,7 +105,7 @@ docker run --name salt_stack --detach \
--env 'SALT_MASTER_SIGN_PUBKEY=True'
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
The container will create the `master_sign` key and its signature. More information about how to configure the minion service can be found [here](https://docs.saltstack.com/en/latest/topics/tutorials/multimaster_pki.html#prepping-the-minion-to-verify-received-public-keys).
@@ -115,7 +115,7 @@ Additionally, you can generate new keys by executing the following command:
```sh
docker run --name salt_stack -it --rm \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:2019.2.3 app:gen-signed-keys other_master_sign
cdalvaro/saltstack-master:3000 app:gen-signed-keys other_master_sign
```
The newly created keys will appear inside `keys/generated/other_master_sign` directory.
@@ -131,7 +131,7 @@ docker run --name salt_stack -it --rm \
--env "USERMAP_UID=$(id -u)" --env "USERMAP_GID=$(id -g)" \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
### Git Fileserver
@@ -187,7 +187,7 @@ docker run --name salt_master --detach \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
--volume $(pwd)/logs/:/home/salt/data/logs/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
Check [Available Configuration Parameters](#available-configuration-parameters) section for configuring logrotate.
@@ -233,7 +233,7 @@ docker run --name salt_master -d \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
--volume $(pwd)/config/:/home/salt/data/config/ \
cdalvaro/saltstack-master:2019.2.3
cdalvaro/saltstack-master:3000
```
## Usage

View File

@@ -1 +1 @@
2019.2.3
3000

View File

@@ -38,6 +38,17 @@ cd libgit2-${LIBGIT2_VERSION}/
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_CLAR=OFF -DTHREADSAFE=ON .
cmake --build . --target install
# Install python3 packages
echo "Installing python3 packages ..."
DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
python3-mako python3-pycryptodome python3-cherrypy3 python3-git python3-u-msgpack \
python3-redis python3-gnupg python3-mysqldb python3-dateutil python3-libnacl
# Install pip3 python packages
echo "Installing pip3 python packages ..."
pip3 install "pygit2==v${PYGIT2_VERSION}" \
"M2Crypto==v${M2CRYPTO_VERSION}"
# Bootstrap script options:
# https://docs.saltstack.com/en/latest/topics/tutorials/salt_bootstrap.html#command-line-options
## -M: install Salt Master by default
@@ -52,18 +63,6 @@ wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
sh bootstrap-salt.sh ${SALT_BOOTSTRAP_OPTS} git v${SALT_VERSION}
chown -R ${SALT_USER}: ${SALT_ROOT_DIR}
# Install python3 packages
echo "Installing python3 packages ..."
DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
python3-mako python3-pycryptodome python3-cherrypy3 python3-git python3-u-msgpack \
python3-ioflo python3-redis python3-gnupg python3-mysqldb python3-dateutil python3-timelib \
python3-raet python3-libnacl
# Install pip3 python packages
echo "Installing pip3 python packages ..."
pip3 install "pygit2==v${PYGIT2_VERSION}" \
"M2Crypto==v${M2CRYPTO_VERSION}"
# Configure ssh
echo "Configuring ssh ..."
sed -i -e "s|^[# ]*StrictHostKeyChecking.*$| StrictHostKeyChecking no|" /etc/ssh/ssh_config
@@ -89,7 +88,7 @@ cat > /etc/supervisor/conf.d/salt-master.conf <<EOF
priority=5
directory=${SALT_HOME}
environment=HOME=${SALT_HOME}
command=/usr/bin/salt-master
command=/usr/local/bin/salt-master
user=${SALT_USER}
autostart=true
autorestart=true

View File

@@ -3,7 +3,7 @@ version: '3'
services:
master:
container_name: salt_master
image: cdalvaro/saltstack-master:2019.2.3
image: cdalvaro/saltstack-master:3000
restart: always
volumes:
- "roots/:/home/salt/data/srv"