mount local $HOME/.azure folder

This commit is contained in:
chrisdias 2017-02-14 14:22:32 +01:00
Родитель 72c158d9db
Коммит 882f2f7243
2 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -26,6 +26,13 @@ You can enable linting of Dockerfile files through the `docker.enableLinting` se
![linting](images/linting.gif)
## Azure CLI
Microsoft ships the latest [Azure CLI](https://github.com/azure/azure-cli) as a [Docker image](https://hub.docker.com/r/azuresdk/azure-cli-python/). You can easily launch a container running the CLI from the Command Palette (press F1 and search for `Docker: Azure CLI`). The extension will then run an interactive terminal attached to the container.
After the container is started, you will be prompted to login to your Azure account. From there, set the subscription you want to work with using `az account set` (you can see all of your subscriptions with `az account list`). You do not need to login in every time you run the container becasue the extension volume mounts the local `$HOME/.azure` folder to the container's `$HOME/.azure` folder.
> If you do not have an Azure subscription, [sign up today](https://azure.microsoft.com/en-us/free/?b=16.48) for a free 30 day account and get **$200** in Azure Credits to try out any combination of Azure services.
## Installation
In VS Code, press F1 and type in `ext install vscode-docker`. Once the extension is installed you will be prompted to restart Visual Studio Code which will only take (literally) a couple of seconds.
@ -34,14 +41,6 @@ Of course, you will want to have Docker installed on your computer in order to r
## Running commands on Linux
By default, Docker runs as the root user, requiring other users to access it with `sudo`. This extension does not assume root access, so you will need to create a Unix group called docker and add users to it. Instructions can be found here: [Create a Docker group](https://docs.docker.com/engine/installation/linux/ubuntulinux/#/create-a-docker-group)
## Azure CLI
Microsoft ships the latest [Azure CLI](https://github.com/azure/azure-cli) as a [Docker image](https://hub.docker.com/r/azuresdk/azure-cli-python/). You can easily launch a container running the CLI from the Command Palette (press F1 and search for `Docker: Azure CLI`). The extension will then run an interactive terminal attached to the container.
After the container is started, you will be prompted to login to your Azure account. From there, set the subscription you want to work with using `az account set` (you can see all of your subscriptions with `az account list`).
> If you do not have an Azure subscription, [sign up today](https://azure.microsoft.com/en-us/free/?b=16.48) for a **free** 30 day account and get **$200** in Azure Credits to try out any combination of Azure services.
## Contributing
There are a couple of ways you can contribute to this repo:

Просмотреть файл

@ -2,6 +2,7 @@ import vscode = require('vscode');
import { ImageItem, quickPickImage } from './utils/quick-pick-image';
import { DockerEngineType, docker } from './utils/docker-endpoint';
import * as cp from 'child_process';
import os = require('os');
function doStartContainer(interactive: boolean) {
@ -46,7 +47,9 @@ export function startAzureCLI() {
});
} else {
let option: string = process.platform === 'linux' ? '--net=host' : '';
let cmd: string = `docker run ${option} -it --rm azuresdk/azure-cli-python:latest`;
// volume map .azure folder so don't have to log in every time
let vol: string = '-v ' + os.homedir() + '/.azure:~/.azure';
let cmd: string = `docker run ${option} ${vol} -it --rm azuresdk/azure-cli-python:latest`;
let terminal: vscode.Terminal = vscode.window.createTerminal('Azure CLI');
terminal.sendText(cmd);