diff --git a/CHANGELOG.md b/CHANGELOG.md index 9496dfe776..5a0ea34606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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. \ No newline at end of file +* Fixed [Issue 51](https://github.com/microsoft/vscode-docker/issues/51), a path problem on Windows. diff --git a/README.md b/README.md index 941b785237..6bfacd308a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/commands/docker-compose.ts b/commands/docker-compose.ts index c9f022ae6b..68897e0a85 100644 --- a/commands/docker-compose.ts +++ b/commands/docker-compose.ts @@ -53,14 +53,17 @@ 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.'); @@ -68,7 +71,7 @@ async function compose(commands: ('up' | 'down')[], message: string, dockerCompo } const items: vscode.QuickPickItem[] = computeItems(folder, uris); - selectedItems.push(await ext.ui.showQuickPick(items, { placeHolder: `Choose Docker Compose file ${message}` })); + selectedItems = [await ext.ui.showQuickPick(items, { placeHolder: `Choose Docker Compose file ${message}` })]; } const terminal: vscode.Terminal = createTerminal('Docker Compose'); diff --git a/configureWorkspace/config-utils.ts b/configureWorkspace/config-utils.ts index 0fb059d060..d385bb03d6 100644 --- a/configureWorkspace/config-utils.ts +++ b/configureWorkspace/config-utils.ts @@ -9,6 +9,7 @@ export type Platform = 'Go' | 'ASP.NET Core' | 'Node.js' | 'Python' | + 'Ruby' | 'Other'; /** @@ -43,6 +44,7 @@ export async function quickPickPlatform(): Promise { 'ASP.NET Core', 'Node.js', 'Python', + 'Ruby', 'Other' ]; diff --git a/configureWorkspace/configure.ts b/configureWorkspace/configure.ts index c0f30f08be..15eb3836cb 100644 --- a/configureWorkspace/configure.ts +++ b/configureWorkspace/configure.ts @@ -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': @@ -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} @@ -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} diff --git a/package.json b/package.json index f1e030534a..f082c19c28 100644 --- a/package.json +++ b/package.json @@ -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.", @@ -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", @@ -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" } } diff --git a/test/configure.test.ts b/test/configure.test.ts index 53cafb68b9..079da75e1d 100644 --- a/test/configure.test.ts +++ b/test/configure.test.ts @@ -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"]'); + }); + }); + // });