This will mostly be docker and Windows. It will follow similar steps for Docker Under Linux. For now, this will be Docker running under Windows using the Command Prompt.
docker pull Ubuntu docker create -it --name Ubuntu_base ubuntu docker start ubuntu_base docker exec -it ubuntu_base bash
You should be connected to the docker container. Now run these commands in docker container. You will have to restart the services. I recommend always installing ssh. There are better ways to get the services to start, but I am keeping this simple.
apt-get update; apt-get install -y vim # After vi installed, create a file with the rest of the # following and do "bash" # these updates will take a while apt-get install -y screen apache2 tmux apt-get install -y ubuntu-system-service postfix apt-get install -y gnupg gnupg1 gnupg2 software-properties-common apt-get install -y wget curl python2 sudo tmux apt-get -y install iproute2 sysstat iftop nmon atop apt-get -y install net-tools lsof dnsutils firewalld apt install -y man-db manpages-posix # This installs ssh with a simple username of mark and password mark. # If you stop the container you will need to restart sshd. apt-get -y install openssh-server echo "" >> /etc/ssh/sshd_config echo "PermitRootLogin yes" >> /etc/ssh/sshd_config service ssh start useradd -m -s /bin/bash mark echo 'mark:mark' | sudo chpasswd echo 'root:root' | sudo chpasswd # This will take a long time, commenting out for now. apt-get install -y man apt-get install -y golang-go apt-get install -y python2 apt-get install -y tripwire #optional. emacs and unminimize will take a long time. apt-get install policycoreutils selinux-utils selinux-basics -y apt-get install emacs -y unminimize apt-get install -y perl apt-get install -y golang-go apt-get install -y default-jre apt-get install -y openjdk-11-jre-headless apt-get install -y openjdk-8-jre-headless apt-get install -y nodejs npm python-software-properties # This should leave the docker container back to the command prompt. #PMM # apt-get install -y lsb-release # wget -O - 'https://repo.proxysql.com/ProxySQL/repo_pub_key' | apt-key add - # echo deb https://repo.proxysql.com/ProxySQL/proxysql-2.2.x/$(lsb_release -sc)/ ./ | tee # apt-get update # apt-get -y install proxysql apt update apt install software-properties-common add-apt-repository --yes --update ppa:ansible/ansible apt install ansible # salt server # add-apt-repository ppa:saltstack/salt # apt-get update # apt-get install salt-master # salt client # apt-get install salt-minion # vim /etc/salt/minion # master: saltmaster.yourserver.com # service salt-minion restart # for nagios4 -- nagios4 messes up apache -- fix # apt-get -y install build-essential libgd-dev # apt install nagios4 # for grafana apt-get -y install apt-utils apt-get install -y apt-transport-https apt-get install -y software-properties-common wget wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list apt-get update apt-get install grafana # for cacti apt -y install php php-{mysql,curl,net-socket,gd,intl,pear,imap,memcache,pspell,tidy,xmlrpc,snmp,mbstring,gmp,json,xml,common,ldap} apt install libapache2-mod-php apt install snmp snmpd snmp-mibs-downloader rrdtool apt-get install -y git apt-get -y install mlocate updatedb exit
Get back to the command prompt and do these commands.
docker stop ubuntu_base docker commit ubuntu_base ubuntu_base_image docker create -it -p 8001:80 -p 2200:22 -p 3106:3306 -v "c:\tmp";/windows --name example ubuntu_base_image docker start example docker exec -it example bash
Inside Docker if you just started the container.
service ssh start service apache2 start
Now you are ready to create other docker images with other services.
docker create -it -p 8000:80 -p 2200:22 -p 4306:3306 -p 4307:3307 -p 4406:3406 -p 4506:3506 --name mysql -v "c:\tmp";/windows ubuntu_base_image docker start mysql docker exec -it mysql bashCommands in bash prompt to container.
apt install -y mariadb-server python3-pip service mysql start sleep 2 service mysql status mysql -u root -e "select 'database is up', now()" apt-get install python3-mysqldb # sudo apt-get install percona-toolkit wget https://downloads.percona.com/downloads/percona-toolkit/3.3.1/binary/debian/focal/x86_64/percona-toolkit_3.3.1-1.focal_amd64.deb dpkg -i percona-toolkit_3.3.1-1.focal_amd64.deb service ssh startmy.cnf files and start files for slaves, ndb, and galera
commands to run