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

Commit

Permalink
azure blockchain dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jun 8, 2019
1 parent 9150757 commit 599e938
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
45 changes: 45 additions & 0 deletions containers/azure-blockchain/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM node:lts

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1

# Install git, process tools
RUN apt-get -y install git procps

# Install Truffle Suite
RUN npm i --unsafe-perm -g truffle

# Install Ganache CLI
RUN npm install -g ganache-cli

# Install the Azure CLI
RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
&& apt-get update \
&& apt-get install -y azure-cli

# Install Python 2.7.15
RUN apt-get install -y build-essential \
&& curl https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz --output Python-2.7.15.tgz \
&& tar -xvf Python-2.7.15.tgz \
&& rm Python-2.7.15.tgz \
&& cd Python-2.7.15 \
&& ./configure --enable-optimizations \
&& make install

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# Set the default shell to bash instead of sh
ENV SHELL /bin/bash
16 changes: 16 additions & 0 deletions containers/azure-blockchain/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Azure Blockchain",
"dockerFile": "Dockerfile",
// Uncomment the next line if you will use a ptrace-based debugger like C++, Go, and Rust.
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment the next line if you want to publish any ports.
// "appPort": [],
// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "az --version",
"extensions": [
"ms-vscode.azurecli",
"azblockchain.azure-blockchain"
]
}
4 changes: 4 additions & 0 deletions containers/azure-blockchain/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
README.md
test-project
.vscode
.npmignore
47 changes: 47 additions & 0 deletions containers/azure-blockchain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Azure Blockchain

## Summary

*Develop with the Azure Blockchain Development Kit for Ethereum. Includes Node.js (latest LTS), git, Truffle Suite, Ganache CLI, the Azure CLI, Python 2.7.15, and related extensions and dependencies.*

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Any |

## Using this definition with an existing folder

This definition requires an Azure subscription to use. You can create a [free account here](https://azure.microsoft.com/en-us/free/). Once you have an Azure account, follow these steps:

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.

2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the Azure Blockchain definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/azure-blockchain/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

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.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/azure-blockchain` folder.
5. After the folder has opened in the container, press <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>`</kbd> to start a new terminal.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

0 comments on commit 599e938

Please sign in to comment.