Public exercises from our Hands on Docker and Hands on Ansible trainings.
To run docker commands you have to ssh into the docker vm.
ssh ubuntu@dockerNow you can run docker and docker-compose commands.
docker version
docker compose version
docker run hello-worldSince you are working on another host when running docker commands you can not use the files directly from editor.
To have the same files like in your editor run the rsync commonand from the workspace host.
rsync -r /home/coder/workspace/hands-on-docker ubuntu@docker:/home/ubuntuTo use ansible you can stay on the standard host.
Always check in which direcotry you are.
$ pwd
/home/coder/workspace/hands-on-ansibleRemeber to always specify the inventory with -i inventory.ymal and the correct path to the playbook when running an ansible command.
ansible-playbook -i inventory.yaml exercises/01-solution-ping/ping.yaml