Skip to content

Commit

Permalink
Merge pull request #18 from cdalvaro/upgrade/v3000
Browse files Browse the repository at this point in the history
Upgrade to v3000 Neon
  • Loading branch information
cdalvaro authored Feb 11, 2020
2 parents dd61408 + 4950a23 commit 6a326d9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" \
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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).
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019.2.3
3000
25 changes: 12 additions & 13 deletions assets/build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6a326d9

Please sign in to comment.