Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

Commit 29fc96b

Browse files
author
Riaan Nolan
committed
Merge branch 'feature/vscode-remote-dev-container' into 'master'
adding devcontainer.json file, adding visual studio code section See merge request all-staff/hashiqube!158
1 parent c19a88c commit 29fc96b

8 files changed

+108
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Now you can use DNS like nomad.service.consul:9999 vault.service.consul:9999 via
121121
* [__Ansible-Tower__](ansible-tower/#ansible-tower) - Is a web-based solution that makes Ansible even more easy to use for IT teams of all kinds. It’s designed to be the hub for all of your automation tasks.
122122
* [__Dbt__](dbt/#dbt) - Dbt is a data transformation tool that enables data analysts and engineers to transform, test and document data in the cloud data warehouse
123123
* [__Airflow__](apache-airflow/#apache-airflow) - Apache Airflow is an open-source workflow management platform for data engineering pipelines
124+
* [__Visual-Studio-Code__](visual-studio-code/#visual-studio-code) - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications
124125

125126
Once the stack is up you will have a large number of services running and available on `localhost` <br />
126127
For Documentation please open http://localhost:3333 in your browser

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
* [Multi-cloud](multi-cloud/README.md)
1818
* [Newrelic-kubernetes-monitoring](newrelic-kubernetes-monitoring/README.md)
1919
* [Typography](typography/README.md)
20+
* [Visual-studio-code](visual-studio-code/README.md)

devcontainer.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// https://code.visualstudio.com/docs/devcontainers/attach-container#:~:text=To%20attach%20to%20a%20Docker,you%20want%20to%20connect%20to
2+
{
3+
// A command string or list of command arguments to run after VS Code attaches to the container
4+
"postStartCommand": "su - vagrant",
5+
6+
// Set *default* container specific settings.json values on container create.
7+
"settings": {
8+
"terminal.integrated.defaultProfile.linux": "bash"
9+
},
10+
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": ["dbaeumer.vscode-eslint"],
13+
14+
// An array port numbers to forward
15+
// "forwardPorts": [8000],
16+
17+
// Indicates the type of shell to use to "probe" for user environment variables to include in VS Code or other connected tool's processes
18+
"userEnvProbe": "loginInteractiveShell",
19+
20+
// Set environment variables for VS Code and sub-processes
21+
"remoteEnv": { "MY_VARIABLE": "some-value" },
22+
23+
// Default path to open when attaching to a new container.
24+
"workspaceFolder": "/vagrant",
25+
26+
// Container user VS Code should use when connecting
27+
"remoteUser": "vagrant"
28+
}

visual-studio-code/README.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Visual Studio Code
2+
3+
https://code.visualstudio.com/
4+
5+
Visual Studio Code or VSCode is a Code Editor, also referred to as an IDE. It's made by Microsoft, it's completely free, very powerful and run on all Operating Systems and Architectures.
6+
7+
It has many extensions and plugins and can help you write betetr code faster.
8+
9+
![VSCode](images/vscode.png?raw=true "VSCode")
10+
11+
## Download and Install VSCode
12+
13+
To use VSCode, please down load it from here:
14+
https://code.visualstudio.com/Download
15+
16+
## Download and Install Popular VSCode Extensions
17+
18+
Also install these popular Extensions to help you get started:
19+
20+
- Azure Terraform Extension
21+
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureterraform
22+
23+
- Terraform Extension
24+
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform
25+
26+
- Install Git History Extension
27+
https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
28+
29+
- Install GitLens Extension
30+
https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
31+
32+
- YAML Extension
33+
https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
34+
35+
- Docker Remote Extension (Dev Containers / Remote Containers)
36+
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
37+
38+
- AWS Toolkit
39+
https://aws.amazon.com/visualstudiocode/
40+
41+
- AWS CloudFormation Extension
42+
https://marketplace.visualstudio.com/items?itemName=aws-scripting-guy.cform
43+
44+
- Dracula Dark Theme
45+
https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula
46+
47+
- Live Share Extension
48+
https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack
49+
50+
## Using Dev Containers also called Remote Containers with VSCode
51+
52+
https://code.visualstudio.com/docs/devcontainers/containers
53+
54+
The Visual Studio Code Dev Containers extension lets you use a container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set. A devcontainer.json file in your project tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack. This container can be used to run an application or to separate tools, libraries, or runtimes needed for working with a codebase.
55+
56+
Workspace files are mounted from the local file system or copied or cloned into the container. Extensions are installed and run inside the container, where they have full access to the tools, platform, and file system. This means that you can seamlessly switch your entire development environment just by connecting to a different container.
57+
58+
## Using Hashiqube as a Dev Container (Development Environment)
59+
60+
- Start Hashiqube with `vagrant up --provision`
61+
62+
- Install the Docker Remote Extension (Dev Containers / Remote Containers)
63+
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
64+
65+
- In VSCode Top Menu, click on View -> Command Palette and type in
66+
`Dev Containers: Attach to Running Container...`
67+
68+
![Dev Containers: Attach to Running Container](images/vscode-view-command-palette-attach-to-running-container.png?raw=true "Dev Containers: Attach to Running Container")
69+
70+
- Select the running Hashiqube Container
71+
72+
![Dev Containers: Attach to Running Container](images/vscode-view-command-palette-attach-to-running-container-select-hashiqube-container.png?raw=true "Dev Containers: Attach to Running Container")
73+
74+
- You are now inside Hashiqube Docker container, and you can work locally an interact with Hashiqube
75+
76+
:bulb: Remember to do `su - vagrant` and `cd /vagrant` to become the vagrant user so that you work as the vagrant user, you can then issue `kubectl` or `terraform` commands if you ran the provisioners first from a terminal on your laptop.
77+
78+
![VSCode](images/vscode-hashiqube-devcontainer.png?raw=true "VSCode")
Loading
Loading

visual-studio-code/images/vscode.png

1.15 MB
Loading

0 commit comments

Comments
 (0)