https://en.wikipedia.org/wiki/Ansible_(software)
https://docs.ansible.com/ansible/latest/user_guide/index.html
https://docs.ansible.com/ansible_community.html
The following command downloads and launches the already built image from Docker Hub (https://hub.docker.com/r/hammadrauf/ansible)
docker run --name ansible-01 -d -it --volume ansible-data:/etc/ansible hammadrauf/ansible
OR The Following command downloads and launches the already built image from Quay.io Regsitry (https://quay.io/repository/hammadrauf/ansible)
docker run --name ansible-01 -d -it --volume ansible-data:/etc/ansible quay.io/hammadrauf/ansible
docker stop ansible-01
docker start ansible-01
docker exec -it ansible-01 /bin/bash
docker ps -a
docker rm -f ansible-01
docker image ls
docker image rm <<IMAGE ID>>
docker image rm b45e3b4b08de
docker image prune
To custimize the Docker Image and build it yourself locally perform the following steps.
git clone https://github.com/hammadrauf/ansible.git
cd ansible
Now do your edits to the Dockerfile or other scripts.
docker build -t ansible .
docker build -t ansible --build-arg ARG_POWER_USER=ansible --build-arg ARG_PU_PWD=ansible .
docker run --name ansible-01 -d -it ansible
ARG_POWER_USER (Default=ansible)
ARG_PU_PWD (Default=ansible)
docker build --tag <<Your Account Name>>/ansible .
docker push .........
- First stop the running target container.
docker stop mycontainer
- Choose a Host backup folder or make one if does not exist.
- Spin a temporary docker container with Host mounted backup folder + plus the predefined volume, and backup the files.
On Linux Host:
$ docker run --rm -v myvolume1:/copythis -v /home/user01/backups:/backups ubuntu bash -c "cd /copythis && tar czvf /backup/site-backup.tar.gz ."
On Windows Host:
C:\> docker run --rm -v myvolume1:/copythis -v "C:\\Users\\user01\\docker_volumes\\backups":/backups ubuntu bash -c "cd /copythis && tar czvf /backup/site-backup.tar.gz ."
- Create a volume that will contain recovered data.
docker volume create my-recovered-volume
- Spin a temporary docker container with Host mounted backups folder + new volume.
On Linux Host:
$ docker run --rm -v my-recovered-volume:/recover -v /home/user01/backups:/backups ubuntu bash -c “cd /recover && tar xzvf /backups/site-backup.tar.gz"
On Windows Host:
C:\> docker run --rm -v my-recovered-volume:/recover -v "C:\\Users\\user01\\docker_volumes\\backups":/backups ubuntu bash -c "cd /recover && tar xzvf /backups/site-backup.tar.gz"
- Start the target container with my-recovered-volume mounted at the correct mount point.
For critical data Remote backup of backup should be performed.