Docker – Quick Reference

A quick reference guide to common Docker commands. # to pull a container image docker pull nginx # to make container – persistant container that mounts conf and webroot docker run –name repo-nginx -p 80:80 –restart unless-stopped -v /data/scratch/repo-nginx:/usr/share/nginx/html -v /data/docker/repo-nginx/default.conf:/etc/nginx # Remove all stopped containers docker system prune -f #to all list containers docker […]

Ansible – Creating playbook that sets user password to vault stored variable

This will use ansible vault that allows the storage of sensitive information in an encrypted state within playbooks. Step 1 – create password that is stored in ansible vault mkdir -p ~/ansible/vault touch ~/ansible/vault/N0s3kr1t cd ~/ansible/vault ## encrypt secret file and prompts for a password ansible-vault encrypt N0s3kr1t ## run the following after installing passlib […]

Vagrant setup – centos7 / docker

# install docker yum install -y yum-utils yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install docker-ce # configure docker systemctl enable docker systemctl start docker # configuring current user in docker group sudo usermod -aG docker $(whoami) # install vagrant yum install -y https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.rpm

Vagrant – VagrantFile

VagrantFile is in ruby syntax. This is configuration that is used when vagrant creates vms. If no directory is given vagrant will mount vagrant folder as shared folder between host and container/vm . To setup custom sync folder Vagrant.configure(“2”) do |config| config.vm.box = ‘centos/7’ # configures synced folder config.vm.synced_folder “./content”, “/vagrant” end To setup multi […]

Vagrant boxes

Vagrant boxes are preconfigured images that can be downloaded from vagrant to create your own homogeneous test environment across multisystems and platforms. using vagrantup to get boxes you can download vagrant boxes (image) from vagrantup.com or create your own use version control if developing your own #vagrant box commands vagrant box add <URL> vagrant box […]