From afd7893afac93e7b56939a2a1ec8cd8213f0a882 Mon Sep 17 00:00:00 2001 From: Tung Leo Date: Mon, 1 Jul 2024 22:56:04 +0700 Subject: [PATCH] Ansible document improvement and minor change image name (#183) --- docs/usage/ansible_usage.md | 16 +++++++++++++--- docs/usage/awscli_usage.md | 4 ++-- docs/usage/azurecli_usage.md | 6 +++--- docs/usage/helm_usage.md | 2 +- docs/usage/kubectl_usage.md | 4 ++-- docs/usage/python_usage.md | 6 +++--- docs/usage/terraform_usage.md | 6 +++--- samples/README.md | 2 +- 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/usage/ansible_usage.md b/docs/usage/ansible_usage.md index ab6312c..08e36e1 100644 --- a/docs/usage/ansible_usage.md +++ b/docs/usage/ansible_usage.md @@ -18,7 +18,7 @@ docker exec -it my_devops_toolkit /bin/bash ## Use case 1: Run Ansible sample code provided in the container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal ansible-playbook samples/ansible/check_os.yml @@ -27,7 +27,7 @@ ansible-playbook samples/ansible/check_os.yml ## Use case 2: Clone external code inside container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal # Now run your cloned script @@ -45,7 +45,17 @@ Clone the code to the host then mount to container ```bash # Given that we have code somewhere in you machine -docker run --rm -v "$(pwd)":/root/ansible_workspace --network host -it devops-toolkit:latest +docker run --rm -v "$(pwd)":/root/ansible_workspace --network host -it tungbq/devops-toolkit:latest +# Run the ansible code as usual +``` + +## Use case 4: Mount external code to container and use .ssh keys from the host + +Clone the code to the host then mount code and `.ssh` folder to container + +```bash +# Given that we have code somewhere in you machine +docker run --rm -v ~/.ssh:/root/.ssh -v "$(pwd)":/root/ansible_workspace --network host -it tungbq/devops-toolkit:latest # Run the ansible code as usual ``` diff --git a/docs/usage/awscli_usage.md b/docs/usage/awscli_usage.md index 3a1dd53..a1959c2 100644 --- a/docs/usage/awscli_usage.md +++ b/docs/usage/awscli_usage.md @@ -22,7 +22,7 @@ docker exec -it my_devops_toolkit /bin/bash ## Use case 1: Configure credentials and list S3 bucket with awscli ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest ############################################### # Now we are in the docker container terminal # ############################################### @@ -47,7 +47,7 @@ Default output format [None]: xxxxxxxx Mount the `.aws` when running toolkit container ```bash -docker run --rm --network host -it -v ~/.aws:/root/.aws devops-toolkit:latest +docker run --rm --network host -it -v ~/.aws:/root/.aws tungbq/devops-toolkit:latest # List bucket aws s3 ls ``` diff --git a/docs/usage/azurecli_usage.md b/docs/usage/azurecli_usage.md index 807eff8..9efbb6b 100644 --- a/docs/usage/azurecli_usage.md +++ b/docs/usage/azurecli_usage.md @@ -21,7 +21,7 @@ docker exec -it my_devops_toolkit /bin/bash ## Use case 1: Az login and run command ```bash -docker run --rm -it devops-toolkit:latest +docker run --rm -it tungbq/devops-toolkit:latest ## To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code to authenticate az login # List all resource groups @@ -33,7 +33,7 @@ az group list Mount the `.azure` folder from host when running toolkit container ```bash -docker run --rm -it -v ~/.azure:/root/.azure devops-toolkit:latest +docker run --rm -it -v ~/.azure:/root/.azure tungbq/devops-toolkit:latest ############################################### # Now we are in the docker container terminal # ############################################### @@ -44,7 +44,7 @@ az group list Sample Result ```bash -➜ ~ docker run --rm -it -v ~/.azure:/root/.azure devops-toolkit:latest +➜ ~ docker run --rm -it -v ~/.azure:/root/.azure tungbq/devops-toolkit:latest root@f097467db632:~# az group list [ { diff --git a/docs/usage/helm_usage.md b/docs/usage/helm_usage.md index 21bca62..473e478 100644 --- a/docs/usage/helm_usage.md +++ b/docs/usage/helm_usage.md @@ -24,7 +24,7 @@ docker exec -it my_devops_toolkit /bin/bash Mount the `.kube/config` file from the host to container (or other kubeconfig files you had) ```bash -docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config devops-toolkit:latest +docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config tungbq/devops-toolkit:latest ############################################### # Now we are in the docker container terminal # ############################################### diff --git a/docs/usage/kubectl_usage.md b/docs/usage/kubectl_usage.md index 277816c..07a7a5e 100644 --- a/docs/usage/kubectl_usage.md +++ b/docs/usage/kubectl_usage.md @@ -20,7 +20,7 @@ docker exec -it my_devops_toolkit /bin/bash Mount the `.kube/config` file from the host to container ```bash -docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config devops-toolkit:latest +docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config tungbq/devops-toolkit:latest ############################################### # Now we are in the docker container terminal # ############################################### @@ -38,7 +38,7 @@ kubectl get deployment Sample Result ```bash -➜ ~ docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config devops-toolkit:latest +➜ ~ docker run --rm --network host -it -v ~/.kube/config:/root/.kube/config tungbq/devops-toolkit:latest root@docker-desktop:~# kubectl get nodes NAME STATUS ROLES AGE VERSION kind-control-plane Ready control-plane 21m v1.29.2 diff --git a/docs/usage/python_usage.md b/docs/usage/python_usage.md index 4961ffd..9047b65 100644 --- a/docs/usage/python_usage.md +++ b/docs/usage/python_usage.md @@ -19,7 +19,7 @@ docker exec -it my_devops_toolkit /bin/bash ## Use case 1: Run python sample code provided in the container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal python3 samples/python/rectangle_area_calculator.py ``` @@ -27,7 +27,7 @@ python3 samples/python/rectangle_area_calculator.py ## Use case 2: Clone external code inside container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal # Clone code mkdir python_workspace @@ -48,7 +48,7 @@ Clone the code to the host then mount to container ```bash # Given that we have code somewhere in you machine -docker run --rm -v "$(pwd)":/root/python_workspace --network host -it devops-toolkit:latest +docker run --rm -v "$(pwd)":/root/python_workspace --network host -it tungbq/devops-toolkit:latest # Run the python code as usual ``` diff --git a/docs/usage/terraform_usage.md b/docs/usage/terraform_usage.md index 6e8e1f6..e213d29 100644 --- a/docs/usage/terraform_usage.md +++ b/docs/usage/terraform_usage.md @@ -18,7 +18,7 @@ docker exec -it my_devops_toolkit /bin/bash ## Use case 1: Run terraform sample code provided in the container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal # Navigate to Terraform sample pushd samples/terraform/basic @@ -34,7 +34,7 @@ popd ## Use case 2: Clone external code inside container ```bash -docker run --rm --network host -it devops-toolkit:latest +docker run --rm --network host -it tungbq/devops-toolkit:latest # You now in the container terminal # Now run your cloned script @@ -52,7 +52,7 @@ Clone the code to the host then mount to container ```bash # Given that we have code somewhere in you machine -docker run --rm -v "$(pwd)":/root/terraform_workspace --network host -it devops-toolkit:latest +docker run --rm -v "$(pwd)":/root/terraform_workspace --network host -it tungbq/devops-toolkit:latest # Run the terraform code as usual ``` diff --git a/samples/README.md b/samples/README.md index 7bb30be..974a488 100644 --- a/samples/README.md +++ b/samples/README.md @@ -5,7 +5,7 @@ Start and dive into the container ```bash -docker run -it --rm devops-toolkit:latest +docker run -it --rm tungbq/devops-toolkit:latest ``` Congrats! You now in the container and able to run the tooling sample inside toolkit, the console will look like: