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

Commit d6620f3

Browse files
authored
Merge pull request #48 from cmendible/master
Added azure-ansible dev container
2 parents fae5912 + 8a517b9 commit d6620f3

File tree

4 files changed

+115
-0
lines changed

4 files changed

+115
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
# Pick any base image, but if you select node, skip installing node. 😊
7+
FROM debian:9
8+
9+
# Configure apt
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
RUN apt-get update \
12+
&& apt-get -y install --no-install-recommends apt-utils 2>&1
13+
14+
# Install git, required tools
15+
RUN apt-get install -y \
16+
git \
17+
curl \
18+
procps \
19+
unzip \
20+
apt-transport-https \
21+
ca-certificates \
22+
gnupg-agent \
23+
software-properties-common \
24+
lsb-release 2>&1
25+
26+
# [Optional] Install Node.js for Azure Cloud Shell support
27+
# Change the "lts/*" in the two lines below to pick a different version
28+
RUN curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \
29+
&& /bin/bash -c "source $HOME/.nvm/nvm.sh \
30+
&& nvm install lts/* \
31+
&& nvm alias default lts/*" 2>&1
32+
33+
# [Optional] For local testing instead of cloud shell
34+
# Install Docker CE CLI.
35+
RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \
36+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
37+
&& apt-get update \
38+
&& apt-get install -y docker-ce-cli
39+
40+
# [Optional] For local testing instead of cloud shell
41+
# Install the Azure CLI
42+
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
43+
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
44+
&& apt-get update \
45+
&& apt-get install -y azure-cli
46+
47+
# Install Ansible
48+
RUN apt-get install -y libssl-dev libffi-dev python-dev python-pip \
49+
&& pip install ansible[azure]
50+
51+
# Clean up
52+
RUN apt-get autoremove -y \
53+
&& apt-get clean -y \
54+
&& rm -rf /var/lib/apt/lists/*
55+
ENV DEBIAN_FRONTEND=dialog
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Azure Ansible",
3+
"dockerFile": "Dockerfile",
4+
"extensions": [
5+
"vscoss.vscode-ansible",
6+
"redhat.vscode-yaml",
7+
"ms-vscode.azurecli"
8+
],
9+
"runArgs": [
10+
"-v",
11+
"/var/run/docker.sock:/var/run/docker.sock"
12+
],
13+
// Uncomment the next line if you want to publish any ports.
14+
// "appPort": [],
15+
// Uncomment the next line to run commands after the container is created.
16+
// "postCreateCommand": "ansible --version"
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
README.md
2+
test-project
3+
.vscode
4+
.npmignore

containers/azure-ansible/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Azure Ansible
2+
3+
## Summary
4+
5+
*Get going quickly with Ansible in Azure. Includes Ansible, the Azure CLI, the Docker CLI (for testing locally), Node.js for Cloud Shell, and related extensions and dependencies.*
6+
7+
| Metadata | Value |
8+
|----------|-------|
9+
| *Contributors* | The VS Code Team |
10+
| *Definition type* | Dockerfile |
11+
| *Languages, platforms* | Ansible |
12+
13+
## Using this definition with an existing folder
14+
15+
While technically optional, this definition includes the Ansible extension. You may need an Azure account for your operations. You can create a [free trial account here](https://azure.microsoft.com/en-us/free/) and find out more about using [Ansible with Azure here](https://docs.microsoft.com/en-us/azure/ansible/ansible-overview). If you plan to use the Azure Cloud Shell for all of your Ansible operations, you can comment out the installation of the Docker CLI in `.devcontainer/Dockerfile`. Conversely, if you do not plan to use Cloud Shell, you can comment out the installation of Node.js. The definition has been setup so you can do either as it makes sense.
16+
17+
Next, follow these steps:
18+
19+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
20+
21+
2. To use VS Code's copy of this definition:
22+
1. Start VS Code and open your project folder.
23+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
24+
3. Select the Azure Ansible definition.
25+
26+
3. To use latest-and-greatest copy of this definition from the repository:
27+
1. Clone this repository.
28+
2. Copy the contents of `containers/azure-ansible/.devcontainer` to the root of your project folder.
29+
3. Start VS Code and open your project folder.
30+
31+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
32+
33+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
34+
35+
## License
36+
37+
Copyright (c) Microsoft Corporation. All rights reserved.
38+
39+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

0 commit comments

Comments
 (0)