DEV Community 👩‍💻👨‍💻

Carlos Mendible
Carlos Mendible

Posted on • Originally published at on

Visual Studio Code Remote Containers: Azure Blockchain

After collaborating with the Azure Ansible container I decided to also develop a Developer Container for those who want or need to use the Azure Blockchain Development Kit for Ethereum to create smart contracts, taking away the burden of installing Python, Truffle, Ganache and NodeJS on your machine.

Once again I collaborated with Chuck Lantz and the container definition resulted in the following two files:

1. devcontainer.json file

This file configures the remote container with the specified extensions

    "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": [

Enter fullscreen mode Exit fullscreen mode

2. Dockerfile

This is the Dockerfile with all the tooling for the Development environment.

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See for license information.

FROM python:2.7

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Configure apt and install packages
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils 2>&1 \
    # Verify git, process tools installed
    && apt-get -y install git procps \
    # Install nodejs
    && curl -sL | bash - \
    && apt-get install -y nodejs \
    # Install Truffle Suite
    && npm i --unsafe-perm -g truffle \
    # Install Ganache CLI
    && npm install -g ganache-cli \
    # Install the Azure CLI
    && apt-get install -y apt-transport-https curl gnupg2 lsb-release \
    && echo "deb [arch=amd64] $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
    && curl -sL | apt-key add - 2>/dev/null \
    && apt-get update \
    && apt-get install -y azure-cli \
    # Clean up
    && apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get

Enter fullscreen mode Exit fullscreen mode

To learn more about this Remote Container please check here.

Hope it helps!

Top comments (0)

All DEV content is created by the community!

Hey, if you're landing here for the first time, you should know that this website is a global community of folks who blog about their experiences to help folks like you out.

Sign up now if you're curious. It's free!