mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2024-12-22 16:33:11 +07:00
3.0 KiB
3.0 KiB
Day 52 - Creating a custom Dev Container for your GitHub Codespace to start with Terraform on Azure
ONE SENTENCE SUMMARY:
Patrick K demonstrates how to create a Dev container for a GitHub repository with Terraform and the Azure CLI, using Visual Studio Code and a Docker file and Dev container JSON file.
MAIN POINTS:
- Create an empty repository on GitHub named
Asia terraform code space
. - Inside the repository, create a
dev container
folder with two files:dockerfile
anddevcontainer.json
. - In the
dockerfile
, install the Asia CLI, Terraform, and other necessary tools using a base image. - Use the
devcontainer.json
to configure the environment for the code space, referencing thedockerfile
. - Commit and push the changes to the main branch of the repository.
- Use Visual Studio Code's Remote Explorer extension to create a new code space from the repository.
- The Dev container will be built and run in the background on a virtual machine.
- Once the code space is finished, Terraform and the Asia CLI should be available within it.
- To stop the Dev container, click 'disconnect' when you no longer need it.
- Rebuild the container to extend it with new tools as needed.
TAKEAWAYS:
- You can create a Dev container for your GitHub code space using Visual Studio Code and two files:
dockerfile
anddevcontainer.json
. - The
dockerfile
installs necessary tools like the Asia CLI and Terraform, while thedevcontainer.json
configures the environment for the code space. - Once you have created the Dev container, you can use it to work with Terraform and the Asia CLI within your GitHub code space.
- To start working with the Dev container, create a new terminal and check if Terraform and the Asia CLI are available.
- Remember to stop the Dev container when you no longer need it to save resources, and rebuild it as needed to extend its functionality. Here is the output:
ONE SENTENCE SUMMARY:
Create a Dev container for your GitHub code space to work with Terraform and the AWS CLI by creating a Docker file and a devcontainer.json file.
MAIN POINTS:
- Create an empty repository named Azure terraform code space.
- Create two files: a Docker file and a devcontainer.json file, inside a dev-container directory.
- Define the base image and install the necessary tools, including AWS CLI and Terraform.
- Configure the devcontainer.json file to set up the environment for your code space.
- Push the changes to the main branch of your repository.
TAKEAWAYS:
- Create a new Dev container for your GitHub code space using Visual Studio Code.
- Use the Docker file to install necessary tools, including AWS CLI and Terraform.
- Configure the devcontainer.json file to set up the environment for your code space.
- Push changes to the main branch of your repository to create the code space.
- Start working with Terraform and the AWS CLI in your code space using the Dev container.