diff --git a/docker/README.md b/docker/README.md index 758b18346..23f72ba71 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,15 +1,37 @@ Versions -------- -These docker images are build with Ubuntu 18.04 (bionic) and Debian 9 (stretch). They use the following repositories to install saltstack: -- https://repo.saltstack.com/apt/debian/9/amd64/latest -- http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest +These docker images are build with: +- CentOS 7 (7.6.1810) +- Debian 9 (stretch) +- Ubuntu 18.04 (bionic) -Version of all salt packages installed: *2018.3.2+ds-1* +They use the following repositories to install saltstack: +- https://repo.saltstack.com/py3/redhat/7/x86_64/archive/${SALT_VERSION} +- https://repo.saltstack.com/apt/debian/9/amd64/archive/${SALT_VERSION} +- http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION} + +Version of all salt packages installed: *SALT_VERSION=2018.3.3* Docker images ------------- -Commands used to build these docker images:: +Commands used to build these docker images (you must be inside `dockerfiles` folder): + +## salt master based on ubuntu +``` +docker build -f dockerfile-saltmaster --tag erwindon/saltgui-saltmaster:2018.3.3 . +``` + +## salt minion based on centos +``` +docker build -f dockerfile-saltminion-centos --tag erwindon/saltgui-saltminion-centos:2018.3.3 . +``` + +## salt minion based on debian +``` +docker build -f dockerfile-saltminion-debian --tag erwindon/saltgui-saltminion-debian:2018.3.3 . +``` - docker build -f dockerfiles/dockerfile-saltmaster -t maerteijn/saltgui-saltmaster . - docker build -f dockerfiles/dockerfile-saltminion-debian -t maerteijn/saltgui-saltminion-debian . - docker build -f dockerfiles/dockerfile-saltminion-ubuntu -t maerteijn/saltgui-saltminion-ubuntu . +## salt minion based on ubuntu +``` +docker build -f dockerfile-saltminion-ubuntu --tag erwindon/saltgui-saltminion-ubuntu:2018.3.3 . +``` diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 231db0ea0..3c160bdda 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: saltmaster-local: - image: maerteijn/saltgui-saltmaster + image: erwindon/saltgui-saltmaster:2018.3.3 hostname: saltmaster-local ports: - 4505:4505 @@ -11,20 +11,24 @@ services: - ./srv/:/srv/ - ./conf/master:/etc/salt/master - ../saltgui:/saltgui - entrypoint: /usr/bin/supervisord saltminion-ubuntu: - image: maerteijn/saltgui-saltminion-ubuntu + image: erwindon/saltgui-saltminion-ubuntu:2018.3.3 hostname: saltminion-ubuntu depends_on: - saltmaster-local restart: on-failure - command: /usr/bin/salt-minion saltminion-debian: - image: maerteijn/saltgui-saltminion-debian + image: erwindon/saltgui-saltminion-debian:2018.3.3 hostname: saltminion-debian depends_on: - saltmaster-local restart: on-failure - command: /usr/bin/salt-minion + + saltminion-centos: + image: erwindon/saltgui-saltminion-centos:2018.3.3 + hostname: saltminion-centos + depends_on: + - saltmaster-local + restart: on-failure diff --git a/docker/conf/minion b/docker/dockerfiles/conf/minion similarity index 100% rename from docker/conf/minion rename to docker/dockerfiles/conf/minion diff --git a/docker/conf/supervisord.conf b/docker/dockerfiles/conf/supervisord.conf similarity index 100% rename from docker/conf/supervisord.conf rename to docker/dockerfiles/conf/supervisord.conf diff --git a/docker/dockerfiles/dockerfile-saltmaster b/docker/dockerfiles/dockerfile-saltmaster index 156f846c7..e3f90b276 100644 --- a/docker/dockerfiles/dockerfile-saltmaster +++ b/docker/dockerfiles/dockerfile-saltmaster @@ -1,30 +1,38 @@ FROM ubuntu:18.04 -MAINTAINER Martijn Jacobs -ENV REFRESHED_ON "24 Jul 2018" -ENV DEBIAN_FRONTEND noninteractive +LABEL maintainer="Erwin Dondorp " +LABEL name=salt-master +LABEL project="SaltGUI testing" +LABEL version=2018.3.3 -# add saltstack key and install dependencies -RUN apt-get update && apt-get install curl net-tools gnupg2 --yes -RUN curl --fail --silent --show-error --location https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - -RUN echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list - -# install salt-master and salt-api, dependencies -RUN apt-get update && apt-get install salt-master salt-api --yes - -# add a user for the frontend salt:salt -RUN useradd -m -s/bin/bash -p $(openssl passwd -1 salt) salt +ENV SALT_VERSION=2018.3.3 +ENV DEBIAN_FRONTEND=noninteractive -# copy the master configuration -ADD ./conf/master /etc/salt/master - -# install supervisor -RUN apt-get install -y supervisor -ADD ./conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +# add saltstack key and install dependencies +RUN apt-get update \ + && apt-get install curl net-tools gnupg2 --yes --no-install-recommends \ + && apt-key adv --fetch-keys http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \ + && echo "deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/archive/${SALT_VERSION} bionic main" > /etc/apt/sources.list.d/saltstack.list \ + # install salt-master and salt-api, dependencies + && apt-get update \ + && apt-get install salt-master=${SALT_VERSION}* salt-api=${SALT_VERSION}* python3-cherrypy3 --yes --no-install-recommends \ + # add a user for the frontend salt:salt + && useradd -m -s/bin/bash -p $(openssl passwd -1 salt) salt \ + # install supervisor + && apt-get install supervisor --yes --no-install-recommends \ + # show which versions are installed + && dpkg -l | grep salt- \ + # cleanup temporary files + && rm -rf /var/lib/apt/lists/* \ + && apt-get -y autoremove \ + && apt-get clean + +# copy supervisord configuration +COPY ./conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # some volume configuration for the saltmaster -VOLUME ["/pki","/var/cache/salt","/var/log/salt"] +VOLUME ["/pki", "/var/cache/salt", "/var/log/salt"] EXPOSE 3333 4505 4506 -# show which versions are installed -RUN dpkg -l | grep salt\- +# define main container command +CMD /usr/bin/supervisord diff --git a/docker/dockerfiles/dockerfile-saltminion-centos b/docker/dockerfiles/dockerfile-saltminion-centos new file mode 100644 index 000000000..7d4ff0430 --- /dev/null +++ b/docker/dockerfiles/dockerfile-saltminion-centos @@ -0,0 +1,28 @@ +FROM centos:7.6.1810 + +LABEL maintainer="Erwin Dondorp " +LABEL name=salt-minion +LABEL project="SaltGUI testing" +LABEL version=2018.3.3 + +ENV SALT_VERSION=2018.3.3 +ENV DEBIAN_FRONTEND=noninteractive + +# add saltstack key and install dependencies +RUN yum install epel-release curl gnupg2 net-tools --assumeyes \ + && rpm --import https://repo.saltstack.com/py3/redhat/7/x86_64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \ + && echo -e "[salt-py3-latest]\nname=SaltStack Latest Release Channel Python 3 for RHEL/Centos \$releasever\nbaseurl=https://repo.saltstack.com/py3/redhat/7/\$basearch/archive/${SALT_VERSION}\nenabled=1\ngpgcheck=1\ngpgkey=https://repo.saltstack.com/py3/redhat/7/\$basearch/latest/SALTSTACK-GPG-KEY.pub\n" > /etc/yum.repos.d/salt-py3-latest.repo \ + # install salt-minion + && yum update --assumeyes \ + && yum install salt-minion-${SALT_VERSION}* --assumeyes \ + # show which versions are installed + && rpm -qa | grep salt- \ + # cleanup temporary files + && rm -rf /var/lib/yum/* /var/cache/yum \ + && yum clean all + +# copy the minion configuration +COPY ./conf/minion /etc/salt/minion + +# define main container command +CMD /usr/bin/salt-minion diff --git a/docker/dockerfiles/dockerfile-saltminion-debian b/docker/dockerfiles/dockerfile-saltminion-debian index 04306c50c..22154a68d 100644 --- a/docker/dockerfiles/dockerfile-saltminion-debian +++ b/docker/dockerfiles/dockerfile-saltminion-debian @@ -1,19 +1,30 @@ FROM debian:9 -MAINTAINER Martijn Jacobs -ENV REFRESHED_ON "24 Jul 2018" -ENV DEBIAN_FRONTEND noninteractive +LABEL maintainer="Erwin Dondorp " +LABEL name=salt-minion +LABEL project="SaltGUI testing" +LABEL version=2018.3.3 -# add saltstack key and install dependencies -RUN apt-get update && apt-get install curl gnupg net-tools --yes -RUN curl --fail --silent --show-error --location https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - -RUN echo 'deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main' > /etc/apt/sources.list.d/saltstack.list +ENV SALT_VERSION=2018.3.3 +ENV DEBIAN_FRONTEND=noninteractive -# install salt-minion -RUN apt-get update && apt-get install salt-minion --yes +# add saltstack key and install dependencies +RUN apt-get update \ + && apt-get install curl dirmngr gnupg net-tools --yes --no-install-recommends \ + && apt-key adv --fetch-keys http://repo.saltstack.com/py3/debian/9/amd64/archive/${SALT_VERSION}/SALTSTACK-GPG-KEY.pub \ + && echo "deb http://repo.saltstack.com/py3/debian/9/amd64/archive/${SALT_VERSION} stretch main" > /etc/apt/sources.list.d/saltstack.list \ + # install salt-minion + && apt-get update \ + && apt-get install salt-minion=${SALT_VERSION}* --yes --no-install-recommends \ + # show which versions are installed + && dpkg -l | grep salt- \ + # cleanup temporary files + && rm -rf /var/lib/apt/lists/* \ + && apt-get -y autoremove \ + && apt-get clean # copy the minion configuration -ADD ./conf/minion /etc/salt/minion +COPY ./conf/minion /etc/salt/minion -# show which versions are installed -RUN dpkg -l | grep salt\- +# define main container command +CMD /usr/bin/salt-minion diff --git a/docker/dockerfiles/dockerfile-saltminion-ubuntu b/docker/dockerfiles/dockerfile-saltminion-ubuntu index a40b25fae..325851fb3 100644 --- a/docker/dockerfiles/dockerfile-saltminion-ubuntu +++ b/docker/dockerfiles/dockerfile-saltminion-ubuntu @@ -1,19 +1,30 @@ FROM ubuntu:18.04 -MAINTAINER Martijn Jacobs -ENV REFRESHED_ON "24 Jul 2018" -ENV DEBIAN_FRONTEND noninteractive +LABEL maintainer="Erwin Dondorp " +LABEL name=salt-minion +LABEL project="SaltGUI testing" +LABEL version=2018.3.3 -# add saltstack key and install dependencies -RUN apt-get update && apt-get install curl gnupg2 net-tools --yes -RUN curl --fail --silent --show-error --location https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - -RUN echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list +ENV SALT_VERSION=2018.3.3 +ENV DEBIAN_FRONTEND=noninteractive -# install salt-minion -RUN apt-get update && apt-get install salt-minion --yes +# add saltstack key and install dependencies +RUN apt-get update \ + && apt-get install curl gnupg2 net-tools --yes --no-install-recommends \ + && apt-key adv --fetch-keys http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub \ + && echo "deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > /etc/apt/sources.list.d/saltstack.list \ + # install salt-minion + && apt-get update \ + && apt-get install salt-minion=${SALT_VERSION}* --yes --no-install-recommends \ + # show which versions are installed + && dpkg -l | grep salt- \ + # cleanup temporary files + && rm -rf /var/lib/apt/lists/* \ + && apt-get -y autoremove \ + && apt-get clean # copy the minion configuration -ADD ./conf/minion /etc/salt/minion +COPY ./conf/minion /etc/salt/minion -# show which versions are installed -RUN dpkg -l | grep salt\- +# define main container command +CMD /usr/bin/salt-minion diff --git a/runtests.sh b/runtests.sh index e4a7f71f6..da2cb4f69 100755 --- a/runtests.sh +++ b/runtests.sh @@ -16,7 +16,7 @@ yarn jslint # and if our css is sane yarn stylelint -# start a salt master, two salt minions and saltgui to run tests on +# start a salt master, three salt minions and saltgui to run tests on docker-compose -f docker/docker-compose.yml up -d # wait until all are up