Skip to content

Commit

Permalink
Merge pull request #21 from AzureCR/master
Browse files Browse the repository at this point in the history
Update dev to match Microsoft/vscode-docker/master
  • Loading branch information
Esteban Rey authored Jul 25, 2018
2 parents 4741f0e + d61e273 commit 05b3138
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 14 deletions.
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
## 0.0.28 - XX May 2018
## 0.1.0 - 26 July 2018
* Update .NET Core Dockerfile generation [#264](https://github.com/Microsoft/vscode-docker/issues/264). Per the .NET team, don't generate `docker-compose` files for .NET Core
* Update to version 0.0.18 of the language server (thanks @rcjsuen) [#291](https://github.com/Microsoft/vscode-docker/pull/291). This includes fixes for:
* command 'vscode-docker.configure' not found [#271](https://github.com/Microsoft/vscode-docker/issues/271)
* Dockerfile linting error in FROM [#269](https://github.com/Microsoft/vscode-docker/issues/269), #280, #288, and others
* Other linting fixes
* Update Linux post-install link in README.md (thanks @gregvanl) [#275](https://github.com/Microsoft/vscode-docker/pull/275)
* Add docker.host setting as alternative for setting DOCKER_HOST environment variable (thanks @tfenster) [#304](https://github.com/Microsoft/vscode-docker/pull/304)
* Basic Dockerfile for Ruby (thanks @MiguelSavignano) [#276](https://github.com/Microsoft/vscode-docker/pull/276)
* Azure container registries bugfixes and enhancements (thanks @estebanreyl, @julialieberman) [#299](https://github.com/Microsoft/vscode-docker/pull/299)
* Fixes [#266](https://github.com/Microsoft/vscode-docker/issues/266) to fix error when expanding empty container registry
* Improves Azure explorer expansion speed by parallelizing network calls
* Alphabetically organized registries listed from azure and organized tags by date of creation
* Add "Docker: Compose Restart" command [#316](https://github.com/Microsoft/vscode-docker/pull/316)
* Add link to extension docs and Azure publish tutorial to readme
* Fix [#295](https://github.com/Microsoft/vscode-docker/issues/295) to provide proper error handling if project file can't be found adding Dockerfile to project
* Fix [#302](https://github.com/Microsoft/vscode-docker/issues/302) so that Compose Up/Down work correctly from the text editor context menu
* Clarify README documentation on DOCKER_HOST to note that DOCKER_CER_PATH may be required for TLS (thanks @mikepatrick) [#324](https://github.com/Microsoft/vscode-docker/pull/324)
* Engineering improvements (tests and lint fixes)

## 0.0.27 - 19 May 2018

Expand Down Expand Up @@ -138,4 +155,4 @@

## 0.0.11 - 4 January 2017

* Fixed [Issue 51](https://github.com/microsoft/vscode-docker/issues/51), a path problem on Windows.
* Fixed [Issue 51](https://github.com/microsoft/vscode-docker/issues/51), a path problem on Windows.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ By default, Docker runs as the root user, requiring other users to access it wit

The default connection of the extension is to connect to the local docker daemon. You can connect to a docker-machine instance if you launch Visual Studio Code and have the DOCKER_HOST environment variable set to a valid host or if you set the `docker.host` configuration setting.

If the docker daemon is using TLS, the DOCKER_CERT_PATH environment variable must also be set (e.g. `$HOME\.docker\machine\machines\default`). See [docker documentation](https://docs.docker.com/machine/reference/env/) for more information.

## Contributing

There are a couple of ways you can contribute to this repository:
Expand Down
19 changes: 11 additions & 8 deletions commands/docker-compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,25 @@ async function compose(commands: ('up' | 'down')[], message: string, dockerCompo
return;
}

let selectedItems: Item[] = [];

if (dockerComposeFileUri) {
// tslint:disable-next-line:prefer-for-of // Grandfathered in
for (let i: number = 0; i < selectedComposeFileUris.length; i++) {
selectedItems.push(createItem(folder, selectedComposeFileUris[i]));
}
let commandParameterFileUris: vscode.Uri[];
if (selectedComposeFileUris && selectedComposeFileUris.length) {
commandParameterFileUris = selectedComposeFileUris;
} else if (dockerComposeFileUri) {
commandParameterFileUris = [dockerComposeFileUri];
} else {
commandParameterFileUris = [];
}
let selectedItems: Item[] = commandParameterFileUris.map(uri => createItem(folder, uri));
if (!selectedItems.length) {
// prompt for compose file
const uris: vscode.Uri[] = await getDockerComposeFileUris(folder);
if (!uris || uris.length === 0) {
vscode.window.showInformationMessage('Couldn\'t find any docker-compose files in your workspace.');
return;
}

const items: vscode.QuickPickItem[] = computeItems(folder, uris);
selectedItems.push(<Item>await ext.ui.showQuickPick(items, { placeHolder: `Choose Docker Compose file ${message}` }));
selectedItems = [<Item>await ext.ui.showQuickPick(items, { placeHolder: `Choose Docker Compose file ${message}` })];
}

const terminal: vscode.Terminal = createTerminal('Docker Compose');
Expand Down
2 changes: 2 additions & 0 deletions configureWorkspace/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type Platform = 'Go' |
'ASP.NET Core' |
'Node.js' |
'Python' |
'Ruby' |
'Other';

/**
Expand Down Expand Up @@ -43,6 +44,7 @@ export async function quickPickPlatform(): Promise<Platform> {
'ASP.NET Core',
'Node.js',
'Python',
'Ruby',
'Other'
];

Expand Down
43 changes: 43 additions & 0 deletions configureWorkspace/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,26 @@ CMD ["python3", "-m", "${serviceName}"]
# Using miniconda (make sure to replace 'myenv' w/ your environment name):
#RUN conda env create -f environment.yml
#CMD /bin/bash -c "source activate myenv && python3 -m ${serviceName}"
`;

case 'ruby':

return `
FROM ruby:2.5-slim
LABEL Name=${serviceName} Version=${version}
EXPOSE ${port}
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
WORKDIR /app
COPY . /app
COPY Gemfile Gemfile.lock ./
RUN bundle install
CMD ["ruby", "${serviceName}.rb"]
`;

case 'java':
Expand Down Expand Up @@ -245,6 +265,16 @@ services:
case 'python':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
build: .
ports:
- ${port}:${port}`;

case 'ruby':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
Expand Down Expand Up @@ -338,6 +368,19 @@ services:
case 'python':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
build:
context: .
dockerfile: Dockerfile
ports:
- ${port}:${port}
`;

case 'ruby':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-docker",
"version": "0.1.0-alpha",
"version": "0.1.0",
"publisher": "PeterJausovec",
"displayName": "Docker",
"description": "Adds syntax highlighting, commands, hover tips, and linting for Dockerfile and docker-compose files.",
Expand Down Expand Up @@ -652,13 +652,13 @@
"@types/fs-extra": "^5.0.4",
"@types/glob": "5.0.35",
"@types/keytar": "^4.0.1",
"@types/mocha": "^5.2.4",
"@types/mocha": "^5.2.5",
"@types/node": "^8.0.34",
"azure-storage": "^2.8.1",
"cross-env": "^5.2.0",
"gulp": "^3.9.1",
"mocha": "5.2.0",
"tslint": "^5.7.0",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "5.0.1",
"typescript": "^2.1.5",
"vsce": "^1.37.5",
Expand All @@ -679,6 +679,6 @@
"request-promise": "^4.2.2",
"vscode-azureextensionui": "~0.15.0",
"vscode-extension-telemetry": "^0.0.6",
"vscode-languageclient": "^4.2.1"
"vscode-languageclient": "4.3.0"
}
}
17 changes: 17 additions & 0 deletions test/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,23 @@ suite("configure (Add Docker files to Workspace)", function (this: Suite): void
});
});

// Ruby

suite("Ruby", () => {
testInEmptyFolder("Ruby", async () => {
await testConfigureDocker('Ruby', undefined /*port*/);

let projectFiles = await getFilesInProject();
assertEx.unorderedArraysEqual(projectFiles, ['Dockerfile', 'docker-compose.debug.yml', 'docker-compose.yml', '.dockerignore'], "The set of files in the project folder after configure was run is not correct.");

assertFileContains('Dockerfile', 'FROM ruby:2.5-slim');
assertFileContains('Dockerfile', 'LABEL Name=testoutput Version=0.0.1');
assertFileContains('Dockerfile', 'COPY Gemfile Gemfile.lock ./');
assertFileContains('Dockerfile', 'RUN bundle install');
assertFileContains('Dockerfile', 'CMD ["ruby", "testoutput.rb"]');
});
});

//

});

0 comments on commit 05b3138

Please sign in to comment.