Skip to content

Commit

Permalink
Merge pull request #27 from cdalvaro/upgrade/v3001
Browse files Browse the repository at this point in the history
Upgrade to v3001
  • Loading branch information
cdalvaro authored Jun 17, 2020
2 parents 6c7fa27 + 6f2f2fe commit 48892ef
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
GITHUB_REF_NAME: ${{ github.event.release.tag_name }}
IMAGE_NAME: cdalvaro/saltstack-master
PLATFORMS: linux/amd64 linux/arm64 linux/arm/v7
PLATFORMS: linux/amd64 linux/arm64
DOCKER_CLI_EXPERIMENTAL: enabled

jobs:
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# 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/3000.3.html) for the list of changes in SaltStack.
Please refer to the SaltStack [Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3001.html) for the list of changes in SaltStack.

**3001**

- Upgrade SaltStack Master to `3001` *Sodium*
- Upgrade Python to version `3.8`
- Upgrade `libgit2` to version `1.0.1`
- Change Docker base image to `ubuntu:focal-20200606`

**3000.3_2**

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM ubuntu:bionic-20200403
FROM ubuntu:focal-20200606

ARG BUILD_DATE
ARG VCS_REF

# https://github.com/saltstack/salt/releases
ENV SALT_VERSION="3000.3" \
PYTHON_VERSION="3.6" \
ENV SALT_VERSION="3001" \
PYTHON_VERSION="3.8" \
LIBSSH2_VERSION="1.9.0" \
LIBGIT2_VERSION="1.0.0" \
LIBGIT2_VERSION="1.0.1" \
PYGIT2_VERSION="1.2.1" \
M2CRYPTO_VERSION="0.35.2"

Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ help:
@echo " 6. make log - view log"

build:
@docker build --tag=cdalvaro/saltstack-master . \
--build-arg=BUILD_DATE="$(shell date +"%Y-%m-%d %H:%M:%S%:z")" \
--build-arg=VCS_REF="$(shell git rev-parse --short HEAD)" \
@docker build --tag=cdalvaro/saltstack-master:latest . \
--build-arg=BUILD_DATE="$(shell date +"%Y-%m-%d %H:%M:%S%:z")" \
--build-arg=VCS_REF="$(shell git rev-parse --short HEAD)"

release: build
@docker build --tag=cdalvaro/saltstack-master:$(shell cat VERSION) . \
--build-arg=BUILD_DATE="$(shell date +"%Y-%m-%d %H:%M:%S%:z")" \
--build-arg=VCS_REF="$(shell git rev-parse --short HEAD)" \
@docker tag cdalvaro/saltstack-master:latest \
cdalvaro/saltstack-master:$(shell cat VERSION)

quickstart:
@echo "Starting saltstack-master container..."
Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Docker Image Size][docker_size_badge]][docker_hub_tags]
[![CodeFactor][codefactor_badge]][codefactor_score]

# Dockerized SaltStack Master v3000.3
# Dockerized SaltStack Master Sodium v3001

Dockerfile to build a [SaltStack](https://www.saltstack.com) Master image for the Docker opensource container platform.

Expand Down Expand Up @@ -41,7 +41,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:3000.3_2
docker pull cdalvaro/saltstack-master:3001
```

You can also pull the latest tag which is built from the repository `HEAD`
Expand Down Expand Up @@ -84,7 +84,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:3000.3_2
cdalvaro/saltstack-master:3001
```

## Configuration
Expand All @@ -111,7 +111,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:3000.3_2
cdalvaro/saltstack-master:3001
```

### Master Signed Keys
Expand All @@ -126,7 +126,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:3000.3_2
cdalvaro/saltstack-master:3001
```

The container will create the `master_sign` key and its signature.
Expand All @@ -138,7 +138,8 @@ 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:3000.3_2 app:gen-signed-keys new_master_sign
cdalvaro/saltstack-master:3001 \
app:gen-signed-keys new_master_sign
```

The newly created keys will appear inside `keys/generated/new_master_sign` directory.
Expand Down Expand Up @@ -167,7 +168,7 @@ docker run --name salt_stack --detach \
--env 'SALT_API_USER_PASS=SuperCool/Password10'
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:3000.3_2
cdalvaro/saltstack-master:3001
```

By default, user `salt_api` is created and you can set its password by setting the environment variable
Expand Down Expand Up @@ -235,7 +236,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:3000.3_2
cdalvaro/saltstack-master:3001
```

### Git Fileserver
Expand Down Expand Up @@ -323,7 +324,7 @@ docker run --name salt_stack -it --rm \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/3pfs/:/home/salt/data/3pfs/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
cdalvaro/saltstack-master:3000.3_2
cdalvaro/saltstack-master:3001
```

If you need to add more third party formulas, you can restart the container, or you can type the following command:
Expand All @@ -347,7 +348,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:3000.3_2
cdalvaro/saltstack-master:3001
```

Check [Available Configuration Parameters](#available-configuration-parameters) section for configuring logrotate.
Expand All @@ -366,7 +367,7 @@ version: '3'
services:
master:
container_name: salt_master
image: cdalvaro/saltstack-master:3000.3_2
image: cdalvaro/saltstack-master:3001
healthcheck:
test: ["CMD", "/usr/local/sbin/healthcheck"]
start_period: 30s
Expand All @@ -385,7 +386,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:3000.3_2
cdalvaro/saltstack-master:3001
```

Then you can manually check this info by running the following command:
Expand Down Expand Up @@ -455,7 +456,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:3000.3_2
cdalvaro/saltstack-master:3001
```

## Usage
Expand Down Expand Up @@ -496,10 +497,10 @@ Where `salt-service` is one of: `salt-master` os `salt-api` (if `SALT_API_SERVIC
- https://docs.saltstack.com/en/latest/topics/tutorials/salt_bootstrap.html
- https://github.com/saltstack/salt/releases

[saltstack_badge]: https://img.shields.io/badge/SaltStack-v3000.3-lightgrey.svg?style=flat&logo=Saltstack
[saltstack_release_notes]: https://docs.saltstack.com/en/latest/topics/releases/3000.3.html "SaltStack Release Notes"
[saltstack_badge]: https://img.shields.io/badge/SaltStack-v3001-lightgrey.svg?style=flat&logo=Saltstack
[saltstack_release_notes]: https://docs.saltstack.com/en/latest/topics/releases/3001.html "SaltStack Release Notes"

[ubuntu_badge]: https://img.shields.io/badge/ubuntu-bionic--20200403-E95420.svg?style=flat&logo=Ubuntu
[ubuntu_badge]: https://img.shields.io/badge/ubuntu-focal--20200606-E95420.svg?style=flat&logo=Ubuntu
[ubuntu_hub_docker]: https://hub.docker.com/_/ubuntu/ "Ubuntu Image"

[github_publish_badge]: https://github.com/cdalvaro/saltstack-master/workflows/Publish/badge.svg
Expand All @@ -509,4 +510,4 @@ Where `salt-service` is one of: `salt-master` os `salt-api` (if `SALT_API_SERVIC
[docker_hub_tags]: https://hub.docker.com/repository/docker/cdalvaro/saltstack-master/tags

[codefactor_badge]: https://img.shields.io/codefactor/grade/github/cdalvaro/saltstack-master?logo=CodeFactor
[codefactor_score]: https://www.codefactor.io/repository/github/cdalvaro/saltstack-master
[codefactor_score]: https://www.codefactor.io/repository/github/cdalvaro/saltstack-master
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3000.3_2
3001
4 changes: 4 additions & 0 deletions assets/build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ BUILD_DEPENDENCIES=(
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends "${BUILD_DEPENDENCIES[@]}"

# Mute sudo RLIMIT_CORE message -> Fixed in sudo 1.8.31p1
echo "Muted sudo RLIMIT_CORE message"
echo "Set disable_coredump false" >> /etc/sudo.conf

# Create salt user
echo "Creating ${SALT_USER} user ..."
useradd -d "${SALT_HOME}" -ms /bin/bash -U -G root,sudo,shadow "${SALT_USER}"
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:3000.3_2
image: cdalvaro/saltstack-master:3001
restart: always
volumes:
- "roots/:/home/salt/data/srv"
Expand Down

0 comments on commit 48892ef

Please sign in to comment.